On Thu, May 05, 2005 at 03:37:28PM -0500, Joshua ben Jore wrote:
> On 4/25/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > 
> > Hello all,
> > 
> > I'd like to run a PoCo::Server::TCP server on 
> > perlmonks.org<http://perlmonks.org>to eliminate as much of the XML ticker 
> > polling as possible. How can I 
> > estimate how many clients the perlmonks.org 
> > <http://perlmonks.org>PoCo::Server::TCP process can serve? Its a FreeBSD 
> > box if that makes a 
> > difference. Some estimates showed peak http server usage at around 50-60 
> > web 
> > clients at a time though this new streaming service may entice other people 
> > to leave their own clients open and siphoning. Maybe twice that many will 
> > actually use this at peak.
> > 
> > If one client starts tarpitting their connection to the PoCo server will 
> > that affect other clients? I think this means that the client stops 
> > responding with ACK or something but I'm no TCP guy. I just recall stuff 
> > like La Brea of a year ago and wonder if someone with a vengeance will be 
> > able to make life for all the other clients miserable.
> > 
> > Joshua ben Jore, diotalevi on perlmonks.org <http://perlmonks.org>
> 
> Was I unclear? Does no one know the answer? POE is a big thing, if someone 
> could point me at where this stuff is controlled, I could at least 
> potentially read that source (but which source...).

POE's TCP support is fairly generic Perl.  There's some sockets, and
there's select() eventually, and some sysread() and syswrite().  I
have never dealt with tarpitting so I can't say whether Perl's socket
I/O (and thus POE's) is susceptible to it.

Thinking about it, I'd have to say that it is.  Perl's sockets are
just C's, so if C is susceptible, so is Perl.  That also means we can
work around this issue somehow, but again I don't know anything about
the problem.

POE::Component::Server::TCP is very generic, and it's probably not the
best module to use for high-performance servers.  For example, it
starts and destroys a POE::Session for every connection, and these are
relatively heavyweight operations.  A better model would be to have a
single session that creates and destroys Wheel objects, since those
are relatively lightweight.

Modules you might find interesting:

  POE::Driver::SysRW
    -- The sysread() and syswrite() abstraction.

  POE::Wheel::ReadWrite
    -- The buffered I/O on unbuffered handles abstraction.

  POE::Filter::Line
  POE::Filter::Stream
    -- Examples of protocol abstractions.

  POE::Loop::*
    -- Event loop abstractions and bridges to external event loops.

Also see CPAN for other examples.

It would also be fair to inform you that these are just different ways
to do similar things.  Since POE is layered and Perl-based, you're
certainly free to write new abstractions that are more specific (and
finer-tuned) to your application.  We also like patches. :)

-- 
Rocco Caputo - http://poe.perl.org/

Reply via email to