Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 83A41200C00 for ; Wed, 18 Jan 2017 13:00:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 82368160B44; Wed, 18 Jan 2017 12:00:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CAB72160B3A for ; Wed, 18 Jan 2017 13:00:35 +0100 (CET) Received: (qmail 87479 invoked by uid 500); 18 Jan 2017 12:00:34 -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 87468 invoked by uid 99); 18 Jan 2017 12:00:34 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2017 12:00:34 +0000 Received: from [192.168.23.9] (host86-152-77-129.range86-152.btcentralplus.com [86.152.77.129]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 9C46C1A0440 for ; Wed, 18 Jan 2017 12:00:33 +0000 (UTC) Subject: Re: Suggested doc change for Connectors To: Tomcat Users List References: <587F52DE.9000808@ice-sa.com> From: Mark Thomas Message-ID: <2f1c4660-0514-ab48-d86f-7ebcd2539b23@apache.org> Date: Wed, 18 Jan 2017 12:00:20 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <587F52DE.9000808@ice-sa.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit archived-at: Wed, 18 Jan 2017 12:00:36 -0000 On 18/01/2017 11:34, André Warnier (tomcat) wrote: > Hi. > > This is a partial recap of the theme discussed on the list, in this > thread : > http://marc.info/?l=tomcat-user&m=148473249120783&w=2 > > I would sugest a documentation change, basically in all pages related to > Connector's configurations, from 9.0, and I believe all the way back to > 6.0. > > The change relates to the "minSpareThreads" attribute of the Connectors, > such as > http://tomcat.apache.org/tomcat-7.0-doc/config/http.html > > and the suggestion is based on : > http://tomcat.apache.org/migration-6.html#Connector_thread_pools > > Basically, each of the Connector pages repeats the same text about this > attribute : > > quote > > minSpareThreads > > The minimum number of threads always kept running. If not specified, the > default of 10 is used. If an executor is associated with this connector, > this attribute is ignored as the connector will execute tasks using the > executor rather than an internal thread pool. Note that if an executor > is configured any value set for this attribute will be recorded > correctly but it will be reported (e.g. via JMX) as -1 to make clear > that it is not used. > > unquote > > So, > - if there is an Executor, then this Connector attribute is ignored > - but according to the above migration guide, if there is no Executor, > it is also ignored. > > So basically, why have it ? Creating a thread is a relatively time consuming task. It ensures that, up to the maximum allowed threads, there are always minSpareThreads available to handle a spike in incoming requests. i.e. - Start with 10 idle threads - 3 new connections arrive - they each get handled by one of the threads - Tomcat starts another 3 threads in the background to bring the spare pool back up to 10 - the 3 connections complete - the spare pool is now 13 If you want the spare pool to be reduced back down to 10 (or some other setting) when threads are idle then you need to use an appropriately configured Executor. The best settings will depend on the load profile. Keeping a thread idle in the background uses relatively little resources. The more 'spikey' your load is, the less benefit you'll get from stopping idle threads. At some point, the load caused by creating and stopping threads will cause more problems than just leaving the threads idle. Maybe change the first sentence to: The number of idle threads Tomcat keeps available to handle new requests. Note that excess idle threads are not stopped. The total number of threads will therefore increase over time with an upper limit of maxThreads. If you require excess idle threads to be stopped, use an Executor. Mark > Of course, I don't know if there is some deeper code reason to keep > mentioning it in the Connectors' documentations. Which is why this is a > suggestion. > > Maybe instead, it could be made clearer that if there is no Executor, > the number of threads associated to a Connector may keep on growing over > time, up to the maxThreads value, and never go down again. > (And the nefarious/beneficial/neutral effects thereof ?) > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org