Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 84146 invoked by uid 500); 8 Jul 2001 14:30:21 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: tomcat-dev@jakarta.apache.org Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 84114 invoked from network); 8 Jul 2001 14:30:18 -0000 From: "Deacon Marcus" To: Subject: RE: Question on HTTPConnector. Date: Sun, 8 Jul 2001 16:33:55 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hi, > -----Original Message----- > From: Craig R. McClanahan [mailto:craigmcc@apache.org] > Sent: Sunday, July 08, 2001 2:45 AM > To: tomcat-dev@jakarta.apache.org > Subject: Re: Question on HTTPConnector. > > > On Sat, 7 Jul 2001 mettu.kumar@redspark.com wrote: > > > > > Looking at org.apache.catalina.connector.http.HTTPConnector I got a > > question regarding the way its implemented.(I am looking at 4.0b3 src) > > > > > > Look at this block of code(in run method of HTTPConnector): > > // Hand this socket off to an appropriate processor > > HttpProcessor processor = createProcessor(); > > if (processor == null) { > > try { > > log(sm.getString("httpConnector.noProcessor")); > > socket.close(); > > } catch (IOException e) { > > ; > > } > > continue; > > } > > > > As per my understanding if no. of HTTPConnections == maxProcessors( > > parameter in server.xml), when a new HTTPRequest comes server just > > closes the Socket with any wait period. > > Yes, that's exactly what happens. > > > Isn't this Bad? In cases where > > Load suddenly increases this could cause problems. > > > > Well yes, it's bad, but so will any other reaction. What choices are > there in handling it? > > (1) Current behavior of closing the connection and go back to > accepting new connections (causes a client-side protocol error) The best option in my opinion. > (2) Pause and try again in a bit (but in the mean time, this > thread cannot accept any new connections, so they stack up > inside the server socket up to acceptCount and then start > getting refused) Now that's BAD :( > (3) Ignore the maxProcessors parameter and create a new processor (and > its associated thread) anyway (can lead to denial of service attacks) We have maxProcessors so site owner can - and should - tune this himself, if he really wants (3) he can just set -1. > Have you a suggestion on how we might deal with this more effectively? > > The real key is to configure maxProcessors to the maximum number of > simultaneous requests you want your server to handle, based on the > hardware capabilities and the processing requirements of your > application. For example, if your response time starts going through the > roof once you exceed N simultaneous requests (because you've encountered > some sort of bottleneck), it doesn't make sense to set maxProcessors > higher than N -- that will just cause response times to slow down for > everyone. > > > > > Any info on this is greatly appreciated. > > > > Thanks, > > Kumar. > > > > Craig > Greetings, deacon Marcus