tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arieh Markel <Arieh.Mar...@central.sun.com>
Subject Re: Problem to limit the number of connections
Date Fri, 08 Dec 2000 16:20:10 GMT

> Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm
> list-help: <mailto:tomcat-dev-help@jakarta.apache.org>
> list-unsubscribe: <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> list-post: <mailto:tomcat-dev@jakarta.apache.org>
> Delivered-To: mailing list tomcat-dev@jakarta.apache.org
> Delivered-To: moderator for tomcat-dev@jakarta.apache.org
> From: Sophie Lemonnier <sophie.lemonnier@alcatel.fr>
> To: tomcat-dev@jakarta.apache.org
> Subject: Problem to limit the number of connections
> X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N
> 
> Hello,
> 
> I have a machine with little ressouces and with other applications than
> tomcat are running.
> Consequently, I would like to prevent too many clients to connect to
> tomcat...
> I haven't managed yet to limit the number of connections....
> Can anyone help me?

Sophie,

you did not mention the version of Tomcat that you are using.

In any case, I believe that for 3.2, the solution is in properties for the
org.apache.tomcat.service.PoolTcpConnector class:

the properties below control the number of threads (which will be associated
with inbound socket connections) that the connector has.

    public static final String THREAD_POOL = "thread_pool";
    public static final String MAX_THREADS = "max_threads";
    public static final String MAX_SPARE_THREADS = "max_spare_threads";
    public static final String MIN_SPARE_THREADS = "min_spare_threads";

What you need to do is modify your server.xml to explicitly set the
property values that are appropriate for you:

(Here is an example from an old server.xml I was using)

	<Connector className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler"
                value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
            <Parameter name="port" value="8180"/>
            <Parameter name="thread_pool" value="on"/>
            <Parameter name="max_threads" value="100"/>
            <Parameter name="max_spare_threads" value="30"/>
            <Parameter name="min_spare_threads" value="10"/>
        </Connector>

Arieh
--
 Arieh Markel		                Sun Microsystems Inc.
 Network Storage                        500 Eldorado Blvd. MS UBRM11-194
 e-mail: arieh.markel@sun.COM           Broomfield, CO 80021
 Let's go Panthers !!!!                 Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)


Mime
View raw message