Re: /dev/poll patch for pen

From: Chris Elsworth <chris_at_shagged.org>
Date: Wed, 14 Dec 2005 10:53:54 +0000

On Wed, Dec 14, 2005 at 10:48:58AM +0100, Ulric Eriksson wrote:
>
> >Hello,
> >
> >I couldn't find any patches for pen to try the Solaris /dev/poll
> >system out, so in a couple of hours of free time I made one:
>
> I tried it myself and it Seems to Work (tm). But that's not
> saying much since it's not on a live system with real traffic.

Hello,

I'm currently using it in a live environment; pen is seeing roughly
14 connections/sec on average amounting to about 700k/sec of traffic.

The only problems I've had were with pen dying with 'Alarm clock'
which I addressed with the second patch, it's been solid since then
(running on Solaris 9 with:
# pen.devpoll -C 8888 -f -r -X -j /jail/apache -u nobody -P localhost:9010 app1:9001 app2:9001 app3:9001 app4:9001
)

Unfortunately my peak concurrent connection count never really goes
much beyond 50 so I won't see much gain from /dev/poll, even select()
wouldn't have a hard time really. But it does prove it works :)

It seems that most of the CPU time used by pen is now in read/write
operations. I tried plugging in sendfile() but the Solaris version
only supports file-descriptor to network-descriptor, so I couldn't
plug it in instead of read/write. I did try replacing the write()
calls with sendfile() from the buffer, but it didn't really seem to
make much difference. The biggest win would be to be able to copy data
between the two sockets without reading into a buffer at all unless
the receiving end isn't ready for it.

I read some (fairly old) work of splice() in Linux which would be nice
to use, but I don't know how far along that is or whether it'll grow
into something usuable: http://lwn.net/Articles/119682/

-- 
Chris
Received on Wed Dec 14 2005 - 11:53:55 CET

This archive was generated by hypermail 2.2.0 : Wed Dec 14 2005 - 11:53:55 CET