Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 67DD810BCB for ; Mon, 6 May 2013 08:38:25 +0000 (UTC) Received: (qmail 23597 invoked by uid 500); 6 May 2013 08:38:21 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 23053 invoked by uid 500); 6 May 2013 08:38:18 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 22940 invoked by uid 99); 6 May 2013 08:38:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 May 2013 08:38:16 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jjakub83@gmail.com designates 209.85.212.46 as permitted sender) Received: from [209.85.212.46] (HELO mail-vb0-f46.google.com) (209.85.212.46) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 May 2013 08:38:12 +0000 Received: by mail-vb0-f46.google.com with SMTP id 10so2689068vbe.19 for ; Mon, 06 May 2013 01:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=lPCAdoZZg/NDKOUJf01C8Q2e/kGzIe1c2RZuCDNqx7I=; b=DigFdgvipyEAPFNFck/pVheU4Bc4Y1cQcHV1KKf5BOiMrajueJK/j6HuZPjEtorxG7 7Pg8L2qD/P1LJIzZrwwOIcvHIYhfBrs9J+2JR+8Qn3uxc0USGiVBDIWBK34LN4Rl5LOn SMsBExBdEDpaMYXmwEHPxh5o1zcr7wUbyD9M3KO/9n6I+2V8TFuoPleJ/ko33pTuus+5 5oWBmsj57NyJ5JSC1TDzV0KX0MwhHs+nYBMqyCA1qd4VAaDRNwj+EjuoFT6dmahRVYQp 89sI1WP3BPBE+eaGzH004Txkgx7Qk+a4vK7pjeHL+mDN3dyZ6jg/uraY9sg8YKTJlFgl FCXw== MIME-Version: 1.0 X-Received: by 10.220.169.78 with SMTP id x14mr6513517vcy.41.1367829471477; Mon, 06 May 2013 01:37:51 -0700 (PDT) Received: by 10.58.135.8 with HTTP; Mon, 6 May 2013 01:37:51 -0700 (PDT) In-Reply-To: <51855EBC.9070102@verizon.net> References: <5184FA11.7040004@ice-sa.com> <51851A7D.4000601@ice-sa.com> <51854456.8050906@apache.org> <51855EBC.9070102@verizon.net> Date: Mon, 6 May 2013 10:37:51 +0200 Message-ID: Subject: Re: Designing for Load on TomCat From: Jakub 1983 To: Tomcat Users List Content-Type: multipart/alternative; boundary=001a11c1e238c2c5ef04dc089d1c X-Virus-Checked: Checked by ClamAV on apache.org --001a11c1e238c2c5ef04dc089d1c Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yogesh "with a page response time of 5 seconds" is it current response time or acceptable await time? if it is current response time, when was it measured, during max load, or during min load ? how many concurrent requests where sent ? why so long ? processor is busy, or communication with external systems , database, webservice, filesystem ? I am not a specialist, but here are my doubts if you do processor intensive task setting much more threads than cpu cores/hyperthreads may not help, it may even slowdown, question arises how much more threads than cores is sensible value: cores +1, 2*cores ? if time is taken mostly by communication - sockets, filesystem, database, webservices, my doubt is: assumption: tomcat uses nio - non blocking IO, so above operation shouldn't block, so my question is why and when do we need more threads ? isn't a thread doing other job when awaiting for NIO ? I would be grateful if somebody more experienced could explain this, and expand this topic. regards Jakub On Sat, May 4, 2013 at 9:17 PM, David Kerber wrote: > On 5/4/2013 1:24 PM, Mark Thomas wrote: > >> On 04/05/2013 16:01, Yogesh wrote: >> >>> Well my question is Is it a common design practice from your experience= s >>> to configure one node (maxthreads) for the scenario where all other nod= es >>> amongst which the load was distribued fail ? >>> >> >> You design for whatever level of resilience you need to meet the >> availability requirements. >> >> Mark >> > > Which IME means allow for either one or two of the cluster nodes to fail, > depending on how many you have to start with. Never all but one, unless > you only have two to begin with. > > > > >> >>> On the cluster part, wrt tomcats talking to each other do you mean the >>> session replication feature or something else ? >>> >>> Sent from my iPhone >>> >>> On May 4, 2013, at 9:26 AM, Andr=E9 Warnier wrote: >>> >>> yogesh hingmire wrote: >>>> >>>> >>>> On Sat, May 4, 2013 at 7:07 AM, Andr=E9 Warnier wrote= : >>>>> >>>>>> yogesh hingmire wrote: >>>>>> >>>>>> While planning / designing to build a web app that must scale to 20= 00 >>>>>>> concurrent users, distributed across 5 Tomcat nodes in a cluster, >>>>>>> Apache >>>>>>> at >>>>>>> the front of course and the ability to serve 20 concurrent requests >>>>>>> per >>>>>>> seconds during business hours, with a page response time of 5 >>>>>>> seconds, how >>>>>>> would we go about the ask ? What Apache / Tomcat / System (CPU/JVM) >>>>>>> parameters should be considered for this design ? >>>>>>> >>>>>> I will provide the ABC, and leave the details for someone else. >>>>>> You have 20 requests arriving per second, and it takes 5 seconds to >>>>>> process one request and return the response. >>>>>> So, over time, it will look like this >>>>>> >>>>>> Time new requests requests in-process requests terminated >>>>>> >>>>>> 0 20 20 0 >>>>>> +1s 20 40 0 >>>>>> +2s 20 60 0 >>>>>> +3s 20 80 0 >>>>>> +4s 20 100 0 >>>>>> +5s 20 100 20 >>>>>> +6s 20 100 40 >>>>>> +7s 20 100 60 >>>>>> etc... >>>>>> >>>>>> So, in principle, and assuming nothing else is going on, you need 10= 0 >>>>>> concurrent threads in Tomcat to process these requests. >>>>>> (I would take a healthy margin of security and double that). >>>>>> Whether for that you need a cluster of Tomcats is another discussion= . >>>>>> And how much memory you need to allocate to your Tomcat(s) JVM(s) is= a >>>>>> function of what your webapp needs, to process one request. >>>>>> >>>>>> The numer of concurrent users should be relatively irrelevant, if al= l >>>>>> you >>>>>> mean by that is that some of these requests come from the same user, >>>>>> but >>>>>> they are otherwise independent of one another. >>>>>> >>>>>> Note that I have a suspicion that what you describe as "requests" >>>>>> above >>>>>> probably only count the requests to your webapp code, and do not >>>>>> count the >>>>>> additional requests for stylesheets, images, etc.. which may be >>>>>> embedded in >>>>>> any page that the user's browser eventually displays. >>>>>> So unless you plan on serving those directly from the Apache httpd >>>>>> front-end, you should take them into account too. >>>>>> >>>>> Thanks Andre and sorry for not mentioning about the other content tha= t >>>>> are >>>>> actually requested by http get's from the jsp served., >>>>> There is quite a lot of ajax calls and static content and that can be >>>>> served out of httpd, but as of now it is not. I know not the best way= , >>>>> >>>> >>>> but you can read the on-line documentation, I presume ? >>>> >>>> so i >>>> >>>>> assume i have to increment my thread count correspondingly.. >>>>> >>>> >>>> Well yes, because then you do not have 20 requests per second, you hav= e >>>> more. >>>> Only you would know how many more, and how long they take to serve, bu= t >>>> the calculation is similar. >>>> >>>> >>>>> While planning to threads on a single node, do i have to take into >>>>> account >>>>> the failure scenario where say all other 4 nodes fail and just this o= ne >>>>> node has to serve out the entire web app load. For that, do i have to >>>>> provision the thread count as many as 4 times what i arrive for a >>>>> single >>>>> node ? >>>>> >>>>> Your thoughts? >>>>> >>>> >>>> I think that you can figure that one out by yourself, no ? >>>> >>>> One more thing, to avoid you looking in the wrong direction : having >>>> one Apache httpd front-end distributing calls to several back-end Tomc= ats, >>>> does not make it so that the Tomcat servers constitute a "cluster". A >>>> "cluster" is a name more usually used when the Tomcats are talking to >>>> eachother. In this case, they would not be. It would just be the >>>> connector, on the Apache httpd side, which distributes the load betwee= n the >>>> back-end Tomcats, and detects when one or more is not working anymore. >>>> >>> > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --001a11c1e238c2c5ef04dc089d1c--