On Fri, 29 Oct 2004 17:45:15 +0200, Andrew Miehs <[EMAIL PROTECTED]> wrote: > Hi Yoav, > > I have not read the Servlet Spec, so please pardon my ignorance. > (Definitely do not mean to offend). What I still haven't had clearly > answered is: > > User A sends request (with keepalive) to tomcat. Tomcat assigns request > to thread (T1). > Tomcat sends result back. Is thread T1 now kept reserved for user A > until he/ or tomcat closes the keep-alive connection?
Yes. > If this is the case, and I now have 1000 users, each with 2 connections > per user (ie: 2000 connections) do I need 2000 threads? What if the > requests each only take a very short amount of time? The server is > capable of answering a lot more requests than those from the 1000 > users, but due to the number of connections and threads, I am limited > to the 1000 users per machine... No. If the number of used threads get higher, timeout will be reduced, and if it gets even higher, keepalive will not be used until the number of connections get lower. > Or am I just missing something here... > > I can understand the issue with the one thread one request in the Spec > - am just wondering if there isn't a better way, as I can not see how > this can possible scale in a high traffic environment - > or maybe I just don't understand... :-( If you have that much connections, I think a number of them will be active doing stuff anyway, so the scalability problems will not be on the number of threads. And then you'll have to experiment a little in test environments to see if disabling keepalive (yes, it's maxKeepAliveRequests="1") would be beneficial or not to the stuff you're running. Keepalive does improve performance significantly because it reduces the work of the TCP stack. BTW, Tomcat performs very well without keepalive, as there's no particular HTTP keepalive optimizations (besides benefitting from lower overhead at the TCP level). -- xxxxxxxxxxxxxxxxxxxxxxxxx Rémy Maucherat Developer & Consultant JBoss Group (Europe) SàRL xxxxxxxxxxxxxxxxxxxxxxxxx --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]