This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients brett.cannon, florin.papa, pitrou, serhiy.storchaka, skrah, vstinner, yselivanov, zbyrne
Date 2016-02-04.09:35:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
For an older project (Fusil the fuzzer), I wrote a short function to sleep until the system load is lower than a threshold. I had to write such function to reduce the noise when the system is heavily loaded. I wrote that to be able to run a very long task (it takes at least 1 hour, but may run for multiple days!) on my desktop and continue to use my desktop for various other tasks.

On Linux, we can use the "cpu xxx xxx xxx ..." line of /proc/stat to get the system load.

My code to read the system load:

My code to wait until the system load is lower than a threshold:


I also write a script to do the opposite :-) A script to stress the system to have a system load higher or equal than a minimum load:

This script helped to me reproduce sporadic failures like timeouts which only occur when the system is highly loaded.
Date User Action Args
2016-02-04 09:35:48vstinnersetrecipients: + vstinner, brett.cannon, pitrou, skrah, serhiy.storchaka, yselivanov, zbyrne, florin.papa
2016-02-04 09:35:48vstinnersetmessageid: <>
2016-02-04 09:35:48vstinnerlinkissue26275 messages
2016-02-04 09:35:47vstinnercreate