I encountered a performance problem in using POE.
main program
------------------
POE::Component::Server::TCP->new(
.....
$wheel = POE::Wheel::Run->new
( Program => 'program_b.pl',
StdoutEvent => "event_reply",
StdioFilter => POE::Filter::Line->new(),
);
.....
);
program_b.pl
----------------------
........
$wheel = POE::Wheel::ReadWrite->new
( InputHandle => \*STDIN,
OutputHandle => \*STDOUT,
InputEvent => "event_input",
Filter => POE::Filter::Line->new(),
);
.......
----------------------------------------------------------------------------
-
A client will connect to the main program by TP connection and send some
data to it.
The main program accept the data and fork/exec a program_b to start the job
processing by POE::Wheel::Run.
The program_b.pl will use POE::Wheel::ReadWrite to connect the pipe, accept
data from main program and
send some data to the main program via the pipe.
The client will continue to send data until it's finished.
My programs works well when there are one or two clients. When there are ten
or tweenty clients connect to the
main server and do the job, data received in program_b.pl will be quite
slow, sometimes daly one or two seconds.
I have no idea which part caused the delay.
I have no blocking functions in my program, such as DBI connection.
My program is running on P-III 1.2G, 512M RAM Linux machine.
I am heavily using POE::Component::Logger in my main program.
Could anyone give me some suggestion about the problem?
George Chung