[JDEV] Performance

Stuart Adamson stuart.adamson at evolution-plc.com
Wed Apr 26 11:20:39 CDT 2000

> | I agree that a pool of threads (shoot, 1000 enough?) 
> servicing all TCP
> | connections would be enough. And I wouldn't doubt there 
> could be a change to
> | the TCP/IP layer in Linux and other operating systems to 
> support a massive
> | number of TCP sockets

Each TCP socket uses memory.  You open a large number of sockets
and you see a slight performance drop off.

Take a look at ircd code to see other problems with dealing with
massive numbers of connection (hint, you can't use select()

> - the problem is that it wasn't 
> really until recently
> | (HTTP) that people had to deal with massive number of TCP 
> sockets at all,

Look at ircd - that handles a large number of TCP sockets and boy is
the code ugly.

> | And 
> having these user
> | threads in 'groups' of native threads will help utilize 
> multiprocessor
> | machines

Yes and no - threads are good under medium load.  Under high
load threads give poor performance.  To handle MP boxes you want
one thread / process per CPU - no more, no less. 

> Long lived connections that are idle most of the time is a silly thing
> to support if it's expensive.

Are a silly thing to support whether they're expensive or not.  
Either get the client / server to disconnect after a period of 
inactivity or use UDP.

Just my 2 pence


More information about the JDev mailing list