tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <>
Subject Re: APR, WebSocket and Servlet 3.1 NIO refactoring
Date Wed, 16 Jan 2013 13:03:47 GMT
On 01/16/2013 01:05 PM, Remy Maucherat wrote:
> On Wed, 2013-01-16 at 11:43 +0000, Mark Thomas wrote:
> It is not really a bug: only the newer Windows (Vista+) have efficient
> polling. With previous versions, small pollsets have to be used because
> (apparently) it can only poll over 64 sockets at a time. If the size is
> over 1000, there is a big performance impact. It is supposed to be
> handled well in APR (using the new APIs if available).
> Source: Mladen some time ago. Hopefully, I understood everything
> correctly ;)

Yeah, correct.
Since Vista (2003R2) MS has added a WSAPoll to winsock API
which allows unlimited number of sockets (I tested that with 12K sockets)
Before that select call has to be used, which is limited by a
#define FD_SIZE 1024 at compile time.
Meaning < 1024 sockets per poller. Beyond that point it's just unusable.

Contemporary APR's have code which does automatic winsock API detection,
so 1000 sockets/pollset is not a limit if running on post XP boxes.

I think we even try to create 5000 socket pollset and if it fails
we create 5 pollsets with 1000 sockets. If support for XP is needed
I'm afraid we'll have to have that dual implementation.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message