Tips for load balancing multiple Python apps on dual/quad coreprocessors?

M

Malcolm Greene

I'm looking for tips on how to load balance running multiple Python
applications in multi-CPU environments. My understanding is that Python
applications and their threads are limited to a specific CPU.

Background: I have a Python utility that processes email messages. I
suspect there's a lot of idle time while this utility waits on a remote
email server. I would like to run as many simultaneous copies of this
utility as possible without overwhelming the server these utilities are
running on. My thought is that I should write a dispatcher that monitors
CPU load and launches/cancels multiple instances of my utility with
specific job queues to process.

Is there a cross-platform way to monitor CPU load?

Is there a pre-existing Python module I should be looking at for
building (subclassing) my dispatcher?

Thanks!
Malcolm
 
P

Paul Rubin

Malcolm Greene said:
Is there a cross-platform way to monitor CPU load?

Cross-platform: not that I know of.

Linux: /proc/loadav (load average),
/proc/cpuinfo (to figure out number of cpu's).

You want the load average and # of cpu's to be about equal,
i.e. all cpu's should be kept busy but not overloaded.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,297
Latest member
EngineerD

Latest Threads

Top