having lots of problems with foreground/background process in cenOS

V

Vlad Iacob

Guest
So short story, I have 2 scripts I want to run in parallel a certain amount of times/ also in parallel .
This is what I have:

for i in {1..100}; do /root/tests/sendmail.pl $num & done
for i in {1..200}; do /root/tests/spamrbl.pl & done

so first script is done 100 times, second 200 ...

The problem I am having is that the script isn't running continually. It like sleeps every second or so for some reason. CPU usage goes up then down then up then down..

The script sends messages to a client. So sendmail sends a message and spamrbl sends a spam message. What I am doign is setting alarm so the main subroutine is called over and over again for 60 seconds. I dont know if this is why it is hiccuping or if it has to do
with the background junk.

Any help would be use
 


You're running 300 separate processes simultaneously! I've never tried that, but I expect it would be very challenging for any scheduler. On top of that, there's limited bandwidth between your machine and the mail server.

Of course I don't know what your scripts are doing, but if each process is negotiating a separate connection to the server from the same IP address, that might possibly cause the server to take notice and throttle you. And if I understood, then each of the first 100 is sending as many messages as it can in a minute.

You're obviously trying to simulate something or stress test some capability. What's your objective?
 

Members online


Latest posts

Top