POE is cooperative, so it's paused while system() does its thing. By detaching the child program with "&", you allow system() to return immediately... which lets POE continue right away.

Unfortunately, by starting 100 copies of the program in a short amount of time, you're probably consuming nontrivial system resources.

--
Rocco Caputo - [EMAIL PROTECTED]


On Sep 4, 2008, at 18:53, poe list wrote:

Hi,

I have developed a POE/JobQueue script that listens for messages off a message queue and then executes one of two programs according to the message along with a re-encapsulation of the message. The programs that are run are relatively long running. Each can take about 5-10 seconds to run. When I run either of the programs in the worker directly, then the performance is really poor. When I enable the debug in JobQueue, I see that workers are created relatively slowly. On the other hand, if I execute the programs (system) w/ a & request ( system ( CMD & ), then the workers are created much faster and the message queue is drained very quickly.

The performance difference is approximately 2 minutes to handle 100 messages when no spawn is requested in the system call. On the other hand, it runs 100 messages
in about 20 seconds when I spawn off the programs.

I am attaching the main script. To effect the behavior change, I simply change the system execution in the CALL subroutine. Any ideas why the performance is so poor when the script doesn't spawn off the calls? I have tested it with 10, 50 and 100
workers.  It makes no difference really.

Thanks,

John
<pagerQ.pl>

Reply via email to