Another nice way to make sure your process doesn't inconvenience users of the machine is to use the unix utility nice.

https://en.wikipedia.org/wiki/Nice_(Unix)

This utility lowers the priority of the instructions your process sends to the CPU.  This allows you to make use of all *available* resources without getting in the way of others running  non-nice'd processed.

-Aaron


On Wed, Aug 28, 2013 at 4:00 PM, Diederik van Liere <dvanliere@wikimedia.org> wrote:
Heya,

A lot of us who write Python code use the multiprocessing module because it's an easy way to distribute the workload among many cpu's. But when you do, please do not allocate all cores to your jobs, because it basically makes a box unavailable to other folks (particularly when your jobs are long-running). You can use the multiprocessing.cpu_count(function to determine the number of available cores and subtract 1 or 2 to make sure that there is some slack available for other processes.

thx!

D

_______________________________________________
Analytics mailing list
Analytics@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/analytics