Thanks for you advice.

Actually program b is also a POE program.
It does the following.
--------------------------------------------
$| = 1;
POE::Component::Server::TCP->new(

    .....
);
...
POE::Session->create(

    # on start up
    $wheel = POE::Wheel::ReadWrite->new
             ( InputHandle  => \*STDIN,
               OutputHandle => \*STDOUT,
               InputEvent   => "event_input",
               Filter       => POE::Filter::Line->new(),
             );

.......
.....
);

After accepting data from the main program via pipe,
it will ask the tcp server to send it to client.
i.e.
data source client -> main program -> program b -> destination client

I suspect two sources of problem.
1. POE::Component::Server::TCP is not concurrent enough.
    After data source client sends data, it's not fast enough to
    fire up event and handle it when there are a lot of client
    connecting to it.

2. The pipe between POE::Wheel::ReadWrite and POE::Wheel::Run
    is not fast enough. I suspect it's the main problem as
POE::Wheel::ReadWrite
    is buffered IO.

BTW, POE seems quite CPU resource hungry. Is there any way to improve it?

Thank you very much.

George Chung

"Rocco Caputo" <[EMAIL PROTECTED]> wrote in message
news:20021102224227.GC35730@;eyrie.homenet...
> [...]
>
> Program b probably doesn't need to be a POE program, especially if
> it's only handling data via STDIN and STDOUT.  For example:
>
>   #!/usr/bin/perl
>   # Program B.
>
>   use warnings;
>   use strict;
>   $| = 1;
>
>   while (<STDIN>) {
>     print reverse;
>   }
>   exit 0;
>
> .... is all you need to process I/O in the child program.
>
> You may be seeing performance problems, especially on startup or
> shutdown, because you're using more resources (memory, CPU) than
> necessary.  Simplifying the child program (if it's possible) will
> probably help.
>
> Please let us know if you need other suggestions.
>
> -- Rocco Caputo - [EMAIL PROTECTED] - http://poe.perl.org/


Reply via email to