I am writing a multiprocessing
routine to run on a server with plenty of CPUs. However, the server has multiple users and its usage may vary. So I would like to adapt the number of processors being used according to the current load.
- Is there a way to estimate the amount of CPUs currently busy in Python? I only found
multiprocessing.cpu_count()
- Bonus question: Is it possible to change
multiprocessing.Pool(processes=no_cpus)
during activity, in case the load on the server has changed after a while?