'Python - how to check system load?
I am writing a script to check if the given urls are proper and resolve an IP. I'd like to fasten things up so I decided to put it into multiple threads. However, I want to make sure that the scripts does not overload the server it runs on. The question is: how can I check system load in the script? Or is there some way to determine how much threads can be run simultanously?
Solution 1:[1]
As suggested in this answer maybe using:
>>> import os
>>> os.getloadavg()
(0.66, 0.69, 0.58)
It's more what you're looking for since that's the server load, not just the cpu usage.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Community |
