Member-only story
Monitoring your devices in Python
Profile and Monitor System Resources in Python using psutil and GPUtil
Why is monitoring system resources important?
If you cannot measure it, you cannot improve it- Lord Kelvin
Monitoring helps to regularly evaluate the performance of the critical system resources like
- CPU
- Memory -RAM, Swap space, and Hard disk space
- Network usage
- GPU usage
Monitoring is critical in identifying the process that is utilizing the most resources and why. It helps to understand if the current system's resources are sufficient for running or a rogue process is consuming too many resources.
Having a limiting threshold on the systems resources will prevent further escalation of the issues and identify an appropriate root cause analysis to fix the issue.
Here we will explore
psutil(process and system utilities) library in Python is a cross-platform library for retrieving information on running processes and system utilization for resources like CPU, memory, disks, network, sensors.