In article <mailman.2256.1256831821.2807.python-l...@python.org>, mk <mrk...@gmail.com> wrote: > >I wrote run-of-the-mill program for concurrent execution of ssh command >over a large number of hosts. (someone may ask why reinvent the wheel >when there's pssh and shmux around -- I'm not happy with working details >and lack of some options in either program) > >The program has a working queue of threads so that no more than >maxthreads number are created and working at particular time. > >But this begs the question: what is the recommended number of threads >working concurrently? If it's dependent on task, the task is: open ssh >connection, execute command (then the main thread loops over the queue >and if the thread is finished, it closes ssh connection and does .join() >on the thread)
Given that you code is not just I/O-bound but wait-bound, I suggest following the suggestion to use asynch code -- then you could open a connection to every single machine simultaneously. Assuming your system setup can handle the load, that is. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ [on old computer technologies and programmers] "Fancy tail fins on a brand new '59 Cadillac didn't mean throwing out a whole generation of mechanics who started with model As." --Andrew Dalke -- http://mail.python.org/mailman/listinfo/python-list