On Fri, December 12, 2003 at 2:12 pm, Adam Fisk wrote:
I'd be happy to send my data to the group if people are interested. Aside from memory, I was surprised to find that the effect on CPU was negligible (not much of a benefit from no context-switching between threads) -- CPU was virtually the same in both cases. So, the scaling benefits on Windows basically come from not having to allocate more memory to new threads. I'm unfortunately not as familiar with the Tomcat code as I'd like to be, but I assume it makes intelligent use of thread pooling, which may even the memory benefits of NIO negligible. At the same time, though, NIO may remove some of the constraints introduced by thread pooling, possibly allowing Tomcat to handle heavier loads without blowing up. An optimized NIO server would if anything out-perform a blocking server, but maybe by not that much.
On current Linux systems, once you start getting 500+ processes/threads active on a typical machine, you will find that context switching starts taking up a significant amount of system time, especially if you decide to run any system moniting tools (like ps, or top). This is better with the upcoming 2.6 kernels, but still doesn't scale to thousands of active threads very well.
For purely switching, the benches I saw saw a linear scaling for the amount on processes in Linnux 2.6. I didn't try it, though.
There would be a significant amount of threads in wait mode. You can't have thousands of threads actually processing stuff anyway, you'll have problems with your database first, or your CPU in the case of XML.
I really wonder sometimes why some people think that NIO would make J2EE scale automagically. It could be a decent optimization for resources use (memory and some threads), but that's it, and it remains to be seen if it wouldn't cause a throughtput drop (in that case, it would be useless, given the amount of memory efficient VMs use to provide a similar throughtput increase).
However, given that you need a thread anyway to server any dynamic content, I don't see NIO helping that much for your typical web application. I could see NIO helping scale the serving of static content which would be useful where people are using Tomcat standalone. Maybe someone can prove me wrong. ;-)
Static content is handled with a regular (well, almost) servlet, and all those requests have to go through the filter pipeline (ie, user components). This is the exact same problem when having Apache serve static files.
Nice try ;-)
Rémy
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]