I need to run a single command on multiple boxes. I am pulling the cpu name from an array then plugging them into a loop. I am then forking the loop so that all of them run at once.<o:p></o:p>
The problem that I am experiencing is: Is there a way to control the number of sessions made at once by the looped fork? <o:p></o:p>
If I am running the command on 20 servers I am OK. However, if I need to run it on all 2000 of the boxes, then I run into MAJOR system resource problems. As a temprary fix I am forking 20 of them, then running 1 outside of the fork. When the 1 from outside of the fork ends then the whole process starts over. This allows me to do them in CHUNKS of 20. What I am looking for is a way that allows a new session to start whenever one ends, so that I have a CONSTANT streem of 25 sessions NOT chunks of 25.<o:p></o:p>
Thanks, BRN </body> </html>##this runs the entire list at once @list=(1,2,3); #list while(<@list>){ #I loop the list if (fork){ #with the loop I run the whole list at once print "$_\n"; #I do my stuff exit; } }
In reply to controling the num of fork sessions by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |