You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by j r <jr...@gmail.com> on 2007/02/15 20:53:03 UTC

Performance tuning parameters

I have searched for exact documentation on this, and I always find
conflicting info.  Therefore I am reaching out to this list.  I have the
following info and questions:

- we are running tomcat 5.5.20
- we have the following configs in server.xml:
           <Connector port="8009"
               enableLookups="false" redirectPort="8443" debug="0"
               maxThreads="750" minSpareThreads="100" maxSpareThreads="250"
               acceptCount="100" connectionTimeout="5000"
tomcatAuthentication="
               false"

- we have extra capacity (mem, cpu, etc.) on the servers, yet tomcat is
hitting connection limits
- we feel that tomcat can serve more, so what do we tune to make it do so?
    - maxThreads?
    - minSpareThreads?
    - maxSpareThreads?
    - acceptCount?


Honestly, I would rather love an exact definition of what each of those
would do to the tomcat server if tweaked.  Knowing that would be nirvana for
tuning.



-j

RE: Performance tuning parameters

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Alan_Mackenzie@Countrywide.Com 
> [mailto:Alan_Mackenzie@Countrywide.Com] 
> Subject: Re: Performance tuning parameters
> 
> - maxThreads
> The maximum number of http worker threads that tomcat will 
> create.  This is the limit of the number of concurrent http
> requests that the server can be servicing at any given moment.

Ideally, it would be the number of concurrent requests, but it's
actually the number of concurrent HTTP connections, unless you're using
APR or the new NIO connector (I think - haven't verified that yet).
When keep-alives are in play for an HTTP connection, Tomcat's standard
connector has to tie up a thread to maintain the connection.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Performance tuning parameters

Posted by j r <jr...@gmail.com>.
Alan,

Thanks for the definitions.  This is good info!



-j

On 2/16/07, Alan_Mackenzie@countrywide.com <Al...@countrywide.com>
wrote:
>
> J.
>
> This is what I've learnt in the last couple of months:
>
> - maxThreads
> The maximum number of http worker threads that tomcat will create.  This
> is the limit of the number of concurrent http requests that the server can
> be servicing at any given moment.  If the thread is waiting for a database
> or webservice call , then the thread is just blocked but it is still part
> of the maxThreads count (750 in your example).  Tomcat will create more
> threads to do the other stuff that needs to be done.
>
> - minSpareThreads
> The number of new threads that tomcat will start when the threadpool has
> become full.    We have the number set down to 20 because it appears that
> the request that triggered the increase waits for all the threads to be
> created (i.e. the pool to get the new stock of threads), before the
> request is handed to one of those threads.
>
> - maxSpareThreads
> When the number of threads that have nothing to do in the threadpool gets
> to this number, tomcat will start removing threads from the threadpool,
> and killing them.
>
> - acceptCount
> This is the number of TCP connections that will be accepted even though
> there may not be a Thread immediately available to service them.  This
> means that in your example you could have 850 incoming request at any
> momemt, Request number 851 will be refused (received a connection
> refused).   We have the acceptCount set to half of the number of threads,
> so that there can be a "big" pile up of work, if our database suddenly
> gets a hickup.
>
>
> Alan M
>
>
>
>
> "Andrew Pliszka" <ap...@alienforceit.com>
> 02/16/2007 11:06 AM
> Please respond to
> "Tomcat Users List" <us...@tomcat.apache.org>
>
>
> To
> "Tomcat Users List" <us...@tomcat.apache.org>
> cc
>
> Subject
> Re: Performance tuning parameters
>
>
>
>
>
>
> Hi,
>
> Do you have any load balancer? I am sorry if this is a trivial
> questions, but I have worked with cases that people have no load
> balancer and connections are just killing them.
>
> Now, if you do not have a load balancer you might consider NetScaler, it
> might lower your number of connections considerably.
>
> Andrew Pliszka
> j r wrote:
>
> > I am gleaning from your comments that MaxThreads is the only thing to
> > tweak.  Yes I do really have a connection issue.  I have millions and
> > millions of connection requests on a very small pool of servers.  The
> app
> > has been tuned constantly over years.  I am either bound to buy more
> > servers
> > or tweak tomcat to get more throughput.  In reality, I probably need
> > to do
> > both.
> >
> > On a large pageview day, we will overflow the 750 MaxThreads.  This is
> > noticed by the MaxThreads limit being exceeded error message.  We have
> > tweaked all pieces of the tomcat config.  I was hoping a post here
> > could get
> > more explanation of the parameters.  We have our experience to fall
> > back on,
> > but I was hoping for more.
> >
> > If MaxThreads is the main thing to tweak, we will continue doing so.
> > There
> > is a limit to this though.  You should create the funnel for customer
> > requests (webserver limits, mod_jk limits, and tomcat limits). Exploding
> > MaxThreads to a large number just to be large does not seem to fit with
> > having an acceptCount value or the funnel that should be created.
> >
> >
> > Thanks,
> > J
> >
> > On 2/16/07, Andrew Miehs <an...@2sheds.de> wrote:
> >
> >>
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> Dear J,
> >>
> >> The focus should be on your application, and configuring everything
> >> thing around that.
> >>
> >> If you REALLY have an out of  connection problem, increase Max
> >> Threads to 10000, but I don't
> >> think that will really help you. The problem is usually that each
> >> individual request takes
> >> tooo long, which again, points back to your application - There isn't
> >> that much to tweak
> >> in tomcat. Once you have configured your application, then you can
> >> start looking at the
> >> kernel - but these only bring small % improvements.
> >>
> >> Without more information - ie: current number of threads being used,
> >> it is very
> >> hard to answer your question.
> >>
> >> Cheers
> >>
> >> Andrew
> >>
> >> On 16/02/2007, at 4:43 AM, j r wrote:
> >>
> >> > The focus should be on the tomcat tweaking.  We get errors in the
> >> > tomcat
> >> > error logs that say tomcat has reached its connection limits.  I
> >> > never said
> >> > that it was serving slow.  It hits connection limits which means
> >> > that the
> >> > app will not serve any more traffic until connections clear.
> >> >
> >> > If a box definitely has more capacity (dual core, dual procs), then
> >> > my best
> >> > guess is that tomcat is not tuned perfectly to allow the max amount
> of
> >> > connections in.  We have raised MaxThreads in the past to allow more
> >> > connections in.  This works, but surely other knobs are important
> >> > to be
> >> > tweaked.
> >> >
> >> > I am looking for good definitions and/or best practices on which
> >> > knobs to
> >> > tweak to allow the max connections in before exhausting the jvm
> native
> >> > memory allocation or cpu on the box.
> >> >
> >> >
> >> >
> >> > Thanks,
> >> > J
> >> >
> >> > On 2/15/07, Andrew Miehs <an...@2sheds.de> wrote:
> >> >>
> >> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> >> Hash: SHA1
> >> >>
> >> >> Dear J'
> >> >>
> >> >> What do you mean you are hitting connection limits?! Are you getting
> >> >> errors? What are you seeing that makes you think that is slow?
> >> >> Is there a database involved in this application?
> >> >>
> >> >> I assume you are running linux on your server, with a 2.6 kernel.
> >> >>
> >> >> run the following commands while your box
> >> >>
> >> >> 1)  ps auxH
> >> >> 2)  ps auxH |grep -c java
> >> >> 3)  vmstat 5 5
> >> >> 4)  iostat 5 3
> >> >>
> >> >> Then we will have a bit of an idea what is going on.
> >> >>
> >> >> Andrew
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> On 15/02/2007, at 9:36 PM, j r wrote:
> >> >>
> >> >> > The reason it is hitting its limits is easy: traffic.  We easily
> >> >> > get enough
> >> >> > website traffic to overflow the connection limits unless I have
> >> >> > many boxes
> >> >> > available to serve.  I know these can be configured to handle more
> >> >> > connections.  I know that we should be able to do this in the
> >> >> tomcat
> >> >> > server.  That is why I need those tweaking parameters defined.
> >> >> >
> >> >> >
> >> >> >
> >> >> > Thanks,
> >> >> > j
> >> >> >
> >> >> > On 2/15/07, Leon Rosenberg <ro...@googlemail.com> wrote:
> >> >> >>
> >> >> >> First you should investigate why tomcat is hitting its limits.
> >> >> >> Why do you think it does? Which resource is the limit?
> >> >> >> Do you have/use any monitoring software? moskito? lambdaprobe?
> >> >> >> tomcat-manager?
> >> >> >>
> >> >> >> regards
> >> >> >> Leon
> >> >> >>
> >> >> >> On 2/15/07, j r <jr...@gmail.com> wrote:
> >> >> >> > I have searched for exact documentation on this, and I always
> >> >> find
> >> >> >> > conflicting info.  Therefore I am reaching out to this list.  I
> >> >> >> have the
> >> >> >> > following info and questions:
> >> >> >> >
> >> >> >> > - we are running tomcat 5.5.20
> >> >> >> > - we have the following configs in server.xml:
> >> >> >> >            <Connector port="8009"
> >> >> >> >                enableLookups="false" redirectPort="8443"
> >> >> debug="0"
> >> >> >> >                maxThreads="750" minSpareThreads="100"
> >> >> >> maxSpareThreads="250"
> >> >> >> >                acceptCount="100" connectionTimeout="5000"
> >> >> >> > tomcatAuthentication="
> >> >> >> >                false"
> >> >> >> >
> >> >> >> > - we have extra capacity (mem, cpu, etc.) on the servers, yet
> >> >> >> tomcat is
> >> >> >> > hitting connection limits
> >> >> >> > - we feel that tomcat can serve more, so what do we tune to
> make
> >> >> >> it do
> >> >> >> so?
> >> >> >> >     - maxThreads?
> >> >> >> >     - minSpareThreads?
> >> >> >> >     - maxSpareThreads?
> >> >> >> >     - acceptCount?
> >> >> >> >
> >> >> >> >
> >> >> >> > Honestly, I would rather love an exact definition of what each
> >> >> >> of those
> >> >> >> > would do to the tomcat server if tweaked.  Knowing that would
> be
> >> >> >> nirvana
> >> >> >> for
> >> >> >> > tuning.
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > -j
> >> >> >> >
> >> >> >>
> >> >> >>
> >> >>
> ---------------------------------------------------------------------
> >> >> >> To start a new topic, e-mail: users@tomcat.apache.org
> >> >> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> >> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >> >> >>
> >> >> >>
> >> >>
> >> >> -----BEGIN PGP SIGNATURE-----
> >> >> Version: GnuPG v1.4.1 (Darwin)
> >> >>
> >> >> iD8DBQFF1NaFW126qUNSzvURAuxZAJ4ugkLObXKHJZsSIfX3SWzZzv5vlQCdHXeV
> >> >> jSPVOQqZXoxvlQc7Q94vMlA=
> >> >> =YSSz
> >> >> -----END PGP SIGNATURE-----
> >> >>
> >> >>
> ---------------------------------------------------------------------
> >> >> To start a new topic, e-mail: users@tomcat.apache.org
> >> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >> >>
> >> >>
> >>
> >> -----BEGIN PGP SIGNATURE-----
> >> Version: GnuPG v1.4.1 (Darwin)
> >>
> >> iD8DBQFF1XNhW126qUNSzvURAtjIAJsHhDX6gXQFPi9UFnFgCPHqB0yGCgCeM7mg
> >> e41/HBE3bGRaol1JAJh81ds=
> >> =5ZBO
> >> -----END PGP SIGNATURE-----
> >>
> >> ---------------------------------------------------------------------
> >> To start a new topic, e-mail: users@tomcat.apache.org
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
> ======================================================================
> Confidentiality Notice: The information contained in and transmitted with
> this communication is strictly confidential, is intended only for the use of
> the intended recipient, and is the property of Countrywide Financial
> Corporation or its affiliates and subsidiaries.  If you are not the intended
> recipient, you are hereby notified that any use of the information contained
> in or transmitted with the communication or dissemination, distribution, or
> copying of this communication is strictly prohibited by law.  If you have
> received this communication in error, please immediately return this
> communication to the sender and delete the original message and any copy of
> it in your possession.
> ======================================================================
>

Re: Performance tuning parameters

Posted by Al...@Countrywide.Com.
J.

This is what I've learnt in the last couple of months: 

- maxThreads
The maximum number of http worker threads that tomcat will create.  This 
is the limit of the number of concurrent http requests that the server can 
be servicing at any given moment.  If the thread is waiting for a database 
or webservice call , then the thread is just blocked but it is still part 
of the maxThreads count (750 in your example).  Tomcat will create more 
threads to do the other stuff that needs to be done.

- minSpareThreads
The number of new threads that tomcat will start when the threadpool has 
become full.    We have the number set down to 20 because it appears that 
the request that triggered the increase waits for all the threads to be 
created (i.e. the pool to get the new stock of threads), before the 
request is handed to one of those threads.

- maxSpareThreads
When the number of threads that have nothing to do in the threadpool gets 
to this number, tomcat will start removing threads from the threadpool, 
and killing them.

- acceptCount
This is the number of TCP connections that will be accepted even though 
there may not be a Thread immediately available to service them.  This 
means that in your example you could have 850 incoming request at any 
momemt, Request number 851 will be refused (received a connection 
refused).   We have the acceptCount set to half of the number of threads, 
so that there can be a "big" pile up of work, if our database suddenly 
gets a hickup.


Alan M




"Andrew Pliszka" <ap...@alienforceit.com> 
02/16/2007 11:06 AM
Please respond to
"Tomcat Users List" <us...@tomcat.apache.org>


To
"Tomcat Users List" <us...@tomcat.apache.org>
cc

Subject
Re: Performance tuning parameters






Hi,

Do you have any load balancer? I am sorry if this is a trivial 
questions, but I have worked with cases that people have no load 
balancer and connections are just killing them.

Now, if you do not have a load balancer you might consider NetScaler, it 
might lower your number of connections considerably.

Andrew Pliszka
j r wrote:

> I am gleaning from your comments that MaxThreads is the only thing to
> tweak.  Yes I do really have a connection issue.  I have millions and
> millions of connection requests on a very small pool of servers.  The 
app
> has been tuned constantly over years.  I am either bound to buy more 
> servers
> or tweak tomcat to get more throughput.  In reality, I probably need 
> to do
> both.
>
> On a large pageview day, we will overflow the 750 MaxThreads.  This is
> noticed by the MaxThreads limit being exceeded error message.  We have
> tweaked all pieces of the tomcat config.  I was hoping a post here 
> could get
> more explanation of the parameters.  We have our experience to fall 
> back on,
> but I was hoping for more.
>
> If MaxThreads is the main thing to tweak, we will continue doing so. 
> There
> is a limit to this though.  You should create the funnel for customer
> requests (webserver limits, mod_jk limits, and tomcat limits). Exploding
> MaxThreads to a large number just to be large does not seem to fit with
> having an acceptCount value or the funnel that should be created.
>
>
> Thanks,
> J
>
> On 2/16/07, Andrew Miehs <an...@2sheds.de> wrote:
>
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Dear J,
>>
>> The focus should be on your application, and configuring everything
>> thing around that.
>>
>> If you REALLY have an out of  connection problem, increase Max
>> Threads to 10000, but I don't
>> think that will really help you. The problem is usually that each
>> individual request takes
>> tooo long, which again, points back to your application - There isn't
>> that much to tweak
>> in tomcat. Once you have configured your application, then you can
>> start looking at the
>> kernel - but these only bring small % improvements.
>>
>> Without more information - ie: current number of threads being used,
>> it is very
>> hard to answer your question.
>>
>> Cheers
>>
>> Andrew
>>
>> On 16/02/2007, at 4:43 AM, j r wrote:
>>
>> > The focus should be on the tomcat tweaking.  We get errors in the
>> > tomcat
>> > error logs that say tomcat has reached its connection limits.  I
>> > never said
>> > that it was serving slow.  It hits connection limits which means
>> > that the
>> > app will not serve any more traffic until connections clear.
>> >
>> > If a box definitely has more capacity (dual core, dual procs), then
>> > my best
>> > guess is that tomcat is not tuned perfectly to allow the max amount 
of
>> > connections in.  We have raised MaxThreads in the past to allow more
>> > connections in.  This works, but surely other knobs are important
>> > to be
>> > tweaked.
>> >
>> > I am looking for good definitions and/or best practices on which
>> > knobs to
>> > tweak to allow the max connections in before exhausting the jvm 
native
>> > memory allocation or cpu on the box.
>> >
>> >
>> >
>> > Thanks,
>> > J
>> >
>> > On 2/15/07, Andrew Miehs <an...@2sheds.de> wrote:
>> >>
>> >> -----BEGIN PGP SIGNED MESSAGE-----
>> >> Hash: SHA1
>> >>
>> >> Dear J'
>> >>
>> >> What do you mean you are hitting connection limits?! Are you getting
>> >> errors? What are you seeing that makes you think that is slow?
>> >> Is there a database involved in this application?
>> >>
>> >> I assume you are running linux on your server, with a 2.6 kernel.
>> >>
>> >> run the following commands while your box
>> >>
>> >> 1)  ps auxH
>> >> 2)  ps auxH |grep -c java
>> >> 3)  vmstat 5 5
>> >> 4)  iostat 5 3
>> >>
>> >> Then we will have a bit of an idea what is going on.
>> >>
>> >> Andrew
>> >>
>> >>
>> >>
>> >>
>> >> On 15/02/2007, at 9:36 PM, j r wrote:
>> >>
>> >> > The reason it is hitting its limits is easy: traffic.  We easily
>> >> > get enough
>> >> > website traffic to overflow the connection limits unless I have
>> >> > many boxes
>> >> > available to serve.  I know these can be configured to handle more
>> >> > connections.  I know that we should be able to do this in the
>> >> tomcat
>> >> > server.  That is why I need those tweaking parameters defined.
>> >> >
>> >> >
>> >> >
>> >> > Thanks,
>> >> > j
>> >> >
>> >> > On 2/15/07, Leon Rosenberg <ro...@googlemail.com> wrote:
>> >> >>
>> >> >> First you should investigate why tomcat is hitting its limits.
>> >> >> Why do you think it does? Which resource is the limit?
>> >> >> Do you have/use any monitoring software? moskito? lambdaprobe?
>> >> >> tomcat-manager?
>> >> >>
>> >> >> regards
>> >> >> Leon
>> >> >>
>> >> >> On 2/15/07, j r <jr...@gmail.com> wrote:
>> >> >> > I have searched for exact documentation on this, and I always
>> >> find
>> >> >> > conflicting info.  Therefore I am reaching out to this list.  I
>> >> >> have the
>> >> >> > following info and questions:
>> >> >> >
>> >> >> > - we are running tomcat 5.5.20
>> >> >> > - we have the following configs in server.xml:
>> >> >> >            <Connector port="8009"
>> >> >> >                enableLookups="false" redirectPort="8443"
>> >> debug="0"
>> >> >> >                maxThreads="750" minSpareThreads="100"
>> >> >> maxSpareThreads="250"
>> >> >> >                acceptCount="100" connectionTimeout="5000"
>> >> >> > tomcatAuthentication="
>> >> >> >                false"
>> >> >> >
>> >> >> > - we have extra capacity (mem, cpu, etc.) on the servers, yet
>> >> >> tomcat is
>> >> >> > hitting connection limits
>> >> >> > - we feel that tomcat can serve more, so what do we tune to 
make
>> >> >> it do
>> >> >> so?
>> >> >> >     - maxThreads?
>> >> >> >     - minSpareThreads?
>> >> >> >     - maxSpareThreads?
>> >> >> >     - acceptCount?
>> >> >> >
>> >> >> >
>> >> >> > Honestly, I would rather love an exact definition of what each
>> >> >> of those
>> >> >> > would do to the tomcat server if tweaked.  Knowing that would 
be
>> >> >> nirvana
>> >> >> for
>> >> >> > tuning.
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > -j
>> >> >> >
>> >> >>
>> >> >>
>> >> 
---------------------------------------------------------------------
>> >> >> To start a new topic, e-mail: users@tomcat.apache.org
>> >> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> >> >> For additional commands, e-mail: users-help@tomcat.apache.org
>> >> >>
>> >> >>
>> >>
>> >> -----BEGIN PGP SIGNATURE-----
>> >> Version: GnuPG v1.4.1 (Darwin)
>> >>
>> >> iD8DBQFF1NaFW126qUNSzvURAuxZAJ4ugkLObXKHJZsSIfX3SWzZzv5vlQCdHXeV
>> >> jSPVOQqZXoxvlQc7Q94vMlA=
>> >> =YSSz
>> >> -----END PGP SIGNATURE-----
>> >>
>> >> 
---------------------------------------------------------------------
>> >> To start a new topic, e-mail: users@tomcat.apache.org
>> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> >> For additional commands, e-mail: users-help@tomcat.apache.org
>> >>
>> >>
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.1 (Darwin)
>>
>> iD8DBQFF1XNhW126qUNSzvURAtjIAJsHhDX6gXQFPi9UFnFgCPHqB0yGCgCeM7mg
>> e41/HBE3bGRaol1JAJh81ds=
>> =5ZBO
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org




======================================================================
Confidentiality Notice: The information contained in and transmitted with this communication is strictly confidential, is intended only for the use of the intended recipient, and is the property of Countrywide Financial Corporation or its affiliates and subsidiaries.  If you are not the intended recipient, you are hereby notified that any use of the information contained in or transmitted with the communication or dissemination, distribution, or copying of this communication is strictly prohibited by law.  If you have received this communication in error, please immediately return this communication to the sender and delete the original message and any copy of it in your possession.
======================================================================

Re: Performance tuning parameters

Posted by Andrew Pliszka <ap...@alienforceit.com>.
Hi,

Do you have any load balancer? I am sorry if this is a trivial 
questions, but I have worked with cases that people have no load 
balancer and connections are just killing them.

Now, if you do not have a load balancer you might consider NetScaler, it 
might lower your number of connections considerably.

Andrew Pliszka
j r wrote:

> I am gleaning from your comments that MaxThreads is the only thing to
> tweak.  Yes I do really have a connection issue.  I have millions and
> millions of connection requests on a very small pool of servers.  The app
> has been tuned constantly over years.  I am either bound to buy more 
> servers
> or tweak tomcat to get more throughput.  In reality, I probably need 
> to do
> both.
>
> On a large pageview day, we will overflow the 750 MaxThreads.  This is
> noticed by the MaxThreads limit being exceeded error message.  We have
> tweaked all pieces of the tomcat config.  I was hoping a post here 
> could get
> more explanation of the parameters.  We have our experience to fall 
> back on,
> but I was hoping for more.
>
> If MaxThreads is the main thing to tweak, we will continue doing so.  
> There
> is a limit to this though.  You should create the funnel for customer
> requests (webserver limits, mod_jk limits, and tomcat limits).  Exploding
> MaxThreads to a large number just to be large does not seem to fit with
> having an acceptCount value or the funnel that should be created.
>
>
> Thanks,
> J
>
> On 2/16/07, Andrew Miehs <an...@2sheds.de> wrote:
>
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Dear J,
>>
>> The focus should be on your application, and configuring everything
>> thing around that.
>>
>> If you REALLY have an out of  connection problem, increase Max
>> Threads to 10000, but I don't
>> think that will really help you. The problem is usually that each
>> individual request takes
>> tooo long, which again, points back to your application - There isn't
>> that much to tweak
>> in tomcat. Once you have configured your application, then you can
>> start looking at the
>> kernel - but these only bring small % improvements.
>>
>> Without more information - ie: current number of threads being used,
>> it is very
>> hard to answer your question.
>>
>> Cheers
>>
>> Andrew
>>
>> On 16/02/2007, at 4:43 AM, j r wrote:
>>
>> > The focus should be on the tomcat tweaking.  We get errors in the
>> > tomcat
>> > error logs that say tomcat has reached its connection limits.  I
>> > never said
>> > that it was serving slow.  It hits connection limits which means
>> > that the
>> > app will not serve any more traffic until connections clear.
>> >
>> > If a box definitely has more capacity (dual core, dual procs), then
>> > my best
>> > guess is that tomcat is not tuned perfectly to allow the max amount of
>> > connections in.  We have raised MaxThreads in the past to allow more
>> > connections in.  This works, but surely other knobs are important
>> > to be
>> > tweaked.
>> >
>> > I am looking for good definitions and/or best practices on which
>> > knobs to
>> > tweak to allow the max connections in before exhausting the jvm native
>> > memory allocation or cpu on the box.
>> >
>> >
>> >
>> > Thanks,
>> > J
>> >
>> > On 2/15/07, Andrew Miehs <an...@2sheds.de> wrote:
>> >>
>> >> -----BEGIN PGP SIGNED MESSAGE-----
>> >> Hash: SHA1
>> >>
>> >> Dear J'
>> >>
>> >> What do you mean you are hitting connection limits?! Are you getting
>> >> errors? What are you seeing that makes you think that is slow?
>> >> Is there a database involved in this application?
>> >>
>> >> I assume you are running linux on your server, with a 2.6 kernel.
>> >>
>> >> run the following commands while your box
>> >>
>> >> 1)  ps auxH
>> >> 2)  ps auxH |grep -c java
>> >> 3)  vmstat 5 5
>> >> 4)  iostat 5 3
>> >>
>> >> Then we will have a bit of an idea what is going on.
>> >>
>> >> Andrew
>> >>
>> >>
>> >>
>> >>
>> >> On 15/02/2007, at 9:36 PM, j r wrote:
>> >>
>> >> > The reason it is hitting its limits is easy: traffic.  We easily
>> >> > get enough
>> >> > website traffic to overflow the connection limits unless I have
>> >> > many boxes
>> >> > available to serve.  I know these can be configured to handle more
>> >> > connections.  I know that we should be able to do this in the
>> >> tomcat
>> >> > server.  That is why I need those tweaking parameters defined.
>> >> >
>> >> >
>> >> >
>> >> > Thanks,
>> >> > j
>> >> >
>> >> > On 2/15/07, Leon Rosenberg <ro...@googlemail.com> wrote:
>> >> >>
>> >> >> First you should investigate why tomcat is hitting its limits.
>> >> >> Why do you think it does? Which resource is the limit?
>> >> >> Do you have/use any monitoring software? moskito? lambdaprobe?
>> >> >> tomcat-manager?
>> >> >>
>> >> >> regards
>> >> >> Leon
>> >> >>
>> >> >> On 2/15/07, j r <jr...@gmail.com> wrote:
>> >> >> > I have searched for exact documentation on this, and I always
>> >> find
>> >> >> > conflicting info.  Therefore I am reaching out to this list.  I
>> >> >> have the
>> >> >> > following info and questions:
>> >> >> >
>> >> >> > - we are running tomcat 5.5.20
>> >> >> > - we have the following configs in server.xml:
>> >> >> >            <Connector port="8009"
>> >> >> >                enableLookups="false" redirectPort="8443"
>> >> debug="0"
>> >> >> >                maxThreads="750" minSpareThreads="100"
>> >> >> maxSpareThreads="250"
>> >> >> >                acceptCount="100" connectionTimeout="5000"
>> >> >> > tomcatAuthentication="
>> >> >> >                false"
>> >> >> >
>> >> >> > - we have extra capacity (mem, cpu, etc.) on the servers, yet
>> >> >> tomcat is
>> >> >> > hitting connection limits
>> >> >> > - we feel that tomcat can serve more, so what do we tune to make
>> >> >> it do
>> >> >> so?
>> >> >> >     - maxThreads?
>> >> >> >     - minSpareThreads?
>> >> >> >     - maxSpareThreads?
>> >> >> >     - acceptCount?
>> >> >> >
>> >> >> >
>> >> >> > Honestly, I would rather love an exact definition of what each
>> >> >> of those
>> >> >> > would do to the tomcat server if tweaked.  Knowing that would be
>> >> >> nirvana
>> >> >> for
>> >> >> > tuning.
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > -j
>> >> >> >
>> >> >>
>> >> >>
>> >> ---------------------------------------------------------------------
>> >> >> To start a new topic, e-mail: users@tomcat.apache.org
>> >> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> >> >> For additional commands, e-mail: users-help@tomcat.apache.org
>> >> >>
>> >> >>
>> >>
>> >> -----BEGIN PGP SIGNATURE-----
>> >> Version: GnuPG v1.4.1 (Darwin)
>> >>
>> >> iD8DBQFF1NaFW126qUNSzvURAuxZAJ4ugkLObXKHJZsSIfX3SWzZzv5vlQCdHXeV
>> >> jSPVOQqZXoxvlQc7Q94vMlA=
>> >> =YSSz
>> >> -----END PGP SIGNATURE-----
>> >>
>> >> ---------------------------------------------------------------------
>> >> To start a new topic, e-mail: users@tomcat.apache.org
>> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> >> For additional commands, e-mail: users-help@tomcat.apache.org
>> >>
>> >>
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.1 (Darwin)
>>
>> iD8DBQFF1XNhW126qUNSzvURAtjIAJsHhDX6gXQFPi9UFnFgCPHqB0yGCgCeM7mg
>> e41/HBE3bGRaol1JAJh81ds=
>> =5ZBO
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Performance tuning parameters

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: j r [mailto:jreynolds11@gmail.com] 
> Subject: Re: Performance tuning parameters
> 
> On a large pageview day, we will overflow the 750 MaxThreads.

Do you have keep-alive enabled for your connectors?  If so, the
connections may be staying open beyond their useful life, tying up a
thread for the duration.  Disabling keep-alives may have performance
ramifications, of course.

I believe the NIO connector in Tomcat 6 alleviates this problem (as does
the APR connector in 5.5 and 6), but I haven't verified that.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Performance tuning parameters

Posted by Andrew Miehs <an...@2sheds.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi JR,

Based on your description of the problem, as you have looked at
everything else, MaxThreads is the only option you have left us with.

Further below however you let slip that mod_jk is also involved.
Why? This is a really great way to kill performance. You now not
only have the scheduling from Tomcat, you also have the same problem
with Apache.

Two other things to play with are keep-alives - and perhaps trying
the tomcat NIO adapter. (This was suggested by 2 other posters)

You will really need to disable keepalives for busy sites, or you will
need to configure a LOT of threads.


On 16/02/2007, at 3:49 PM, j r wrote:

> I am gleaning from your comments that MaxThreads is the only thing to
> tweak.  Yes I do really have a connection issue.  I have millions and
> millions of connection requests on a very small pool of servers.   
> The app
> has been tuned constantly over years.  I am either bound to buy  
> more servers
> or tweak tomcat to get more throughput.  In reality, I probably  
> need to do
> both.

Why are you running out of connections?

How many requests per second are you getting?
How long does it take to deal with one request?
Do you have keepalives disabled? (The should be if you have so much  
traffic)

Two be honest, the 750 threads are only really going to help you
to deal with 'spikes' in traffic - or you have 750 cores to deal with  
your traffic.
At some stage (after you have saturated your backend queues) your  
application
will need to ramp down this number....

For example, if your machine can only deal with 100 requests per  
second, and you are
receiving 200 requests per second, this will, after about 8 seconds  
expand over your thread limit.
This is of course a simplified model, but the same is true if the  
application
sends requests to the backend which can only deal with x requests per  
second.

I would run a 'ps auxH |grep -c java' every minute (or perhaps even  
every 10 sec)
to see what is going on - I would suggest that you probably have a  
cyclical number
of connections. I would possibly do the same with apache as well, as  
you will probably
have the same problem here.


> On a large pageview day, we will overflow the 750 MaxThreads.  This is
> noticed by the MaxThreads limit being exceeded error message.  We have
> tweaked all pieces of the tomcat config.  I was hoping a post here  
> could get
> more explanation of the parameters.  We have our experience to fall  
> back on,
> but I was hoping for more.

I would seriously suggest monitoring the number of threads you are using
- - as 750 connector threads does not really sound healthy
- - and I hope you running this on Linux with so many threads...


> If MaxThreads is the main thing to tweak, we will continue doing  
> so.  There
> is a limit to this though.  You should create the funnel for customer
> requests (webserver limits, mod_jk limits, and tomcat limits).   
> Exploding
> MaxThreads to a large number just to be large does not seem to fit  
> with
> having an acceptCount value or the funnel that should be created.

I honestly do not believe that 'tweaking' MaxThreads will do anything  
other
than to help you get around 'spikes' in your traffic.

One of the sites I am working for also has millions of requests, and  
our thread
count varies from 200 threads at any one time (based on a complicated  
backend)
to 90 threads on a simple tomcat logging application.

I would also recommend separating your static/ image traffic from your
dynamic content - using separate urls.

Regards

Andrew

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFF2N90W126qUNSzvURAooQAJwKWtXqkp+WgatZ/jT2gFu7OOSBoACdG2kG
izsIiWZQssyAHG+Kbd2jwBk=
=CsVm
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Performance tuning parameters

Posted by j r <jr...@gmail.com>.
I am gleaning from your comments that MaxThreads is the only thing to
tweak.  Yes I do really have a connection issue.  I have millions and
millions of connection requests on a very small pool of servers.  The app
has been tuned constantly over years.  I am either bound to buy more servers
or tweak tomcat to get more throughput.  In reality, I probably need to do
both.

On a large pageview day, we will overflow the 750 MaxThreads.  This is
noticed by the MaxThreads limit being exceeded error message.  We have
tweaked all pieces of the tomcat config.  I was hoping a post here could get
more explanation of the parameters.  We have our experience to fall back on,
but I was hoping for more.

If MaxThreads is the main thing to tweak, we will continue doing so.  There
is a limit to this though.  You should create the funnel for customer
requests (webserver limits, mod_jk limits, and tomcat limits).  Exploding
MaxThreads to a large number just to be large does not seem to fit with
having an acceptCount value or the funnel that should be created.


Thanks,
J

On 2/16/07, Andrew Miehs <an...@2sheds.de> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dear J,
>
> The focus should be on your application, and configuring everything
> thing around that.
>
> If you REALLY have an out of  connection problem, increase Max
> Threads to 10000, but I don't
> think that will really help you. The problem is usually that each
> individual request takes
> tooo long, which again, points back to your application - There isn't
> that much to tweak
> in tomcat. Once you have configured your application, then you can
> start looking at the
> kernel - but these only bring small % improvements.
>
> Without more information - ie: current number of threads being used,
> it is very
> hard to answer your question.
>
> Cheers
>
> Andrew
>
> On 16/02/2007, at 4:43 AM, j r wrote:
>
> > The focus should be on the tomcat tweaking.  We get errors in the
> > tomcat
> > error logs that say tomcat has reached its connection limits.  I
> > never said
> > that it was serving slow.  It hits connection limits which means
> > that the
> > app will not serve any more traffic until connections clear.
> >
> > If a box definitely has more capacity (dual core, dual procs), then
> > my best
> > guess is that tomcat is not tuned perfectly to allow the max amount of
> > connections in.  We have raised MaxThreads in the past to allow more
> > connections in.  This works, but surely other knobs are important
> > to be
> > tweaked.
> >
> > I am looking for good definitions and/or best practices on which
> > knobs to
> > tweak to allow the max connections in before exhausting the jvm native
> > memory allocation or cpu on the box.
> >
> >
> >
> > Thanks,
> > J
> >
> > On 2/15/07, Andrew Miehs <an...@2sheds.de> wrote:
> >>
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> Dear J'
> >>
> >> What do you mean you are hitting connection limits?! Are you getting
> >> errors? What are you seeing that makes you think that is slow?
> >> Is there a database involved in this application?
> >>
> >> I assume you are running linux on your server, with a 2.6 kernel.
> >>
> >> run the following commands while your box
> >>
> >> 1)  ps auxH
> >> 2)  ps auxH |grep -c java
> >> 3)  vmstat 5 5
> >> 4)  iostat 5 3
> >>
> >> Then we will have a bit of an idea what is going on.
> >>
> >> Andrew
> >>
> >>
> >>
> >>
> >> On 15/02/2007, at 9:36 PM, j r wrote:
> >>
> >> > The reason it is hitting its limits is easy: traffic.  We easily
> >> > get enough
> >> > website traffic to overflow the connection limits unless I have
> >> > many boxes
> >> > available to serve.  I know these can be configured to handle more
> >> > connections.  I know that we should be able to do this in the
> >> tomcat
> >> > server.  That is why I need those tweaking parameters defined.
> >> >
> >> >
> >> >
> >> > Thanks,
> >> > j
> >> >
> >> > On 2/15/07, Leon Rosenberg <ro...@googlemail.com> wrote:
> >> >>
> >> >> First you should investigate why tomcat is hitting its limits.
> >> >> Why do you think it does? Which resource is the limit?
> >> >> Do you have/use any monitoring software? moskito? lambdaprobe?
> >> >> tomcat-manager?
> >> >>
> >> >> regards
> >> >> Leon
> >> >>
> >> >> On 2/15/07, j r <jr...@gmail.com> wrote:
> >> >> > I have searched for exact documentation on this, and I always
> >> find
> >> >> > conflicting info.  Therefore I am reaching out to this list.  I
> >> >> have the
> >> >> > following info and questions:
> >> >> >
> >> >> > - we are running tomcat 5.5.20
> >> >> > - we have the following configs in server.xml:
> >> >> >            <Connector port="8009"
> >> >> >                enableLookups="false" redirectPort="8443"
> >> debug="0"
> >> >> >                maxThreads="750" minSpareThreads="100"
> >> >> maxSpareThreads="250"
> >> >> >                acceptCount="100" connectionTimeout="5000"
> >> >> > tomcatAuthentication="
> >> >> >                false"
> >> >> >
> >> >> > - we have extra capacity (mem, cpu, etc.) on the servers, yet
> >> >> tomcat is
> >> >> > hitting connection limits
> >> >> > - we feel that tomcat can serve more, so what do we tune to make
> >> >> it do
> >> >> so?
> >> >> >     - maxThreads?
> >> >> >     - minSpareThreads?
> >> >> >     - maxSpareThreads?
> >> >> >     - acceptCount?
> >> >> >
> >> >> >
> >> >> > Honestly, I would rather love an exact definition of what each
> >> >> of those
> >> >> > would do to the tomcat server if tweaked.  Knowing that would be
> >> >> nirvana
> >> >> for
> >> >> > tuning.
> >> >> >
> >> >> >
> >> >> >
> >> >> > -j
> >> >> >
> >> >>
> >> >>
> >> ---------------------------------------------------------------------
> >> >> To start a new topic, e-mail: users@tomcat.apache.org
> >> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >> >>
> >> >>
> >>
> >> -----BEGIN PGP SIGNATURE-----
> >> Version: GnuPG v1.4.1 (Darwin)
> >>
> >> iD8DBQFF1NaFW126qUNSzvURAuxZAJ4ugkLObXKHJZsSIfX3SWzZzv5vlQCdHXeV
> >> jSPVOQqZXoxvlQc7Q94vMlA=
> >> =YSSz
> >> -----END PGP SIGNATURE-----
> >>
> >> ---------------------------------------------------------------------
> >> To start a new topic, e-mail: users@tomcat.apache.org
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (Darwin)
>
> iD8DBQFF1XNhW126qUNSzvURAtjIAJsHhDX6gXQFPi9UFnFgCPHqB0yGCgCeM7mg
> e41/HBE3bGRaol1JAJh81ds=
> =5ZBO
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Performance tuning parameters

Posted by Andrew Miehs <an...@2sheds.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear J,

The focus should be on your application, and configuring everything  
thing around that.

If you REALLY have an out of  connection problem, increase Max  
Threads to 10000, but I don't
think that will really help you. The problem is usually that each  
individual request takes
tooo long, which again, points back to your application - There isn't  
that much to tweak
in tomcat. Once you have configured your application, then you can  
start looking at the
kernel - but these only bring small % improvements.

Without more information - ie: current number of threads being used,  
it is very
hard to answer your question.

Cheers

Andrew

On 16/02/2007, at 4:43 AM, j r wrote:

> The focus should be on the tomcat tweaking.  We get errors in the  
> tomcat
> error logs that say tomcat has reached its connection limits.  I  
> never said
> that it was serving slow.  It hits connection limits which means  
> that the
> app will not serve any more traffic until connections clear.
>
> If a box definitely has more capacity (dual core, dual procs), then  
> my best
> guess is that tomcat is not tuned perfectly to allow the max amount of
> connections in.  We have raised MaxThreads in the past to allow more
> connections in.  This works, but surely other knobs are important  
> to be
> tweaked.
>
> I am looking for good definitions and/or best practices on which  
> knobs to
> tweak to allow the max connections in before exhausting the jvm native
> memory allocation or cpu on the box.
>
>
>
> Thanks,
> J
>
> On 2/15/07, Andrew Miehs <an...@2sheds.de> wrote:
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Dear J'
>>
>> What do you mean you are hitting connection limits?! Are you getting
>> errors? What are you seeing that makes you think that is slow?
>> Is there a database involved in this application?
>>
>> I assume you are running linux on your server, with a 2.6 kernel.
>>
>> run the following commands while your box
>>
>> 1)  ps auxH
>> 2)  ps auxH |grep -c java
>> 3)  vmstat 5 5
>> 4)  iostat 5 3
>>
>> Then we will have a bit of an idea what is going on.
>>
>> Andrew
>>
>>
>>
>>
>> On 15/02/2007, at 9:36 PM, j r wrote:
>>
>> > The reason it is hitting its limits is easy: traffic.  We easily
>> > get enough
>> > website traffic to overflow the connection limits unless I have
>> > many boxes
>> > available to serve.  I know these can be configured to handle more
>> > connections.  I know that we should be able to do this in the  
>> tomcat
>> > server.  That is why I need those tweaking parameters defined.
>> >
>> >
>> >
>> > Thanks,
>> > j
>> >
>> > On 2/15/07, Leon Rosenberg <ro...@googlemail.com> wrote:
>> >>
>> >> First you should investigate why tomcat is hitting its limits.
>> >> Why do you think it does? Which resource is the limit?
>> >> Do you have/use any monitoring software? moskito? lambdaprobe?
>> >> tomcat-manager?
>> >>
>> >> regards
>> >> Leon
>> >>
>> >> On 2/15/07, j r <jr...@gmail.com> wrote:
>> >> > I have searched for exact documentation on this, and I always  
>> find
>> >> > conflicting info.  Therefore I am reaching out to this list.  I
>> >> have the
>> >> > following info and questions:
>> >> >
>> >> > - we are running tomcat 5.5.20
>> >> > - we have the following configs in server.xml:
>> >> >            <Connector port="8009"
>> >> >                enableLookups="false" redirectPort="8443"  
>> debug="0"
>> >> >                maxThreads="750" minSpareThreads="100"
>> >> maxSpareThreads="250"
>> >> >                acceptCount="100" connectionTimeout="5000"
>> >> > tomcatAuthentication="
>> >> >                false"
>> >> >
>> >> > - we have extra capacity (mem, cpu, etc.) on the servers, yet
>> >> tomcat is
>> >> > hitting connection limits
>> >> > - we feel that tomcat can serve more, so what do we tune to make
>> >> it do
>> >> so?
>> >> >     - maxThreads?
>> >> >     - minSpareThreads?
>> >> >     - maxSpareThreads?
>> >> >     - acceptCount?
>> >> >
>> >> >
>> >> > Honestly, I would rather love an exact definition of what each
>> >> of those
>> >> > would do to the tomcat server if tweaked.  Knowing that would be
>> >> nirvana
>> >> for
>> >> > tuning.
>> >> >
>> >> >
>> >> >
>> >> > -j
>> >> >
>> >>
>> >>  
>> ---------------------------------------------------------------------
>> >> To start a new topic, e-mail: users@tomcat.apache.org
>> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> >> For additional commands, e-mail: users-help@tomcat.apache.org
>> >>
>> >>
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.1 (Darwin)
>>
>> iD8DBQFF1NaFW126qUNSzvURAuxZAJ4ugkLObXKHJZsSIfX3SWzZzv5vlQCdHXeV
>> jSPVOQqZXoxvlQc7Q94vMlA=
>> =YSSz
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFF1XNhW126qUNSzvURAtjIAJsHhDX6gXQFPi9UFnFgCPHqB0yGCgCeM7mg
e41/HBE3bGRaol1JAJh81ds=
=5ZBO
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Performance tuning parameters

Posted by j r <jr...@gmail.com>.
The focus should be on the tomcat tweaking.  We get errors in the tomcat
error logs that say tomcat has reached its connection limits.  I never said
that it was serving slow.  It hits connection limits which means that the
app will not serve any more traffic until connections clear.

If a box definitely has more capacity (dual core, dual procs), then my best
guess is that tomcat is not tuned perfectly to allow the max amount of
connections in.  We have raised MaxThreads in the past to allow more
connections in.  This works, but surely other knobs are important to be
tweaked.

I am looking for good definitions and/or best practices on which knobs to
tweak to allow the max connections in before exhausting the jvm native
memory allocation or cpu on the box.



Thanks,
J

On 2/15/07, Andrew Miehs <an...@2sheds.de> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dear J'
>
> What do you mean you are hitting connection limits?! Are you getting
> errors? What are you seeing that makes you think that is slow?
> Is there a database involved in this application?
>
> I assume you are running linux on your server, with a 2.6 kernel.
>
> run the following commands while your box
>
> 1)  ps auxH
> 2)  ps auxH |grep -c java
> 3)  vmstat 5 5
> 4)  iostat 5 3
>
> Then we will have a bit of an idea what is going on.
>
> Andrew
>
>
>
>
> On 15/02/2007, at 9:36 PM, j r wrote:
>
> > The reason it is hitting its limits is easy: traffic.  We easily
> > get enough
> > website traffic to overflow the connection limits unless I have
> > many boxes
> > available to serve.  I know these can be configured to handle more
> > connections.  I know that we should be able to do this in the tomcat
> > server.  That is why I need those tweaking parameters defined.
> >
> >
> >
> > Thanks,
> > j
> >
> > On 2/15/07, Leon Rosenberg <ro...@googlemail.com> wrote:
> >>
> >> First you should investigate why tomcat is hitting its limits.
> >> Why do you think it does? Which resource is the limit?
> >> Do you have/use any monitoring software? moskito? lambdaprobe?
> >> tomcat-manager?
> >>
> >> regards
> >> Leon
> >>
> >> On 2/15/07, j r <jr...@gmail.com> wrote:
> >> > I have searched for exact documentation on this, and I always find
> >> > conflicting info.  Therefore I am reaching out to this list.  I
> >> have the
> >> > following info and questions:
> >> >
> >> > - we are running tomcat 5.5.20
> >> > - we have the following configs in server.xml:
> >> >            <Connector port="8009"
> >> >                enableLookups="false" redirectPort="8443" debug="0"
> >> >                maxThreads="750" minSpareThreads="100"
> >> maxSpareThreads="250"
> >> >                acceptCount="100" connectionTimeout="5000"
> >> > tomcatAuthentication="
> >> >                false"
> >> >
> >> > - we have extra capacity (mem, cpu, etc.) on the servers, yet
> >> tomcat is
> >> > hitting connection limits
> >> > - we feel that tomcat can serve more, so what do we tune to make
> >> it do
> >> so?
> >> >     - maxThreads?
> >> >     - minSpareThreads?
> >> >     - maxSpareThreads?
> >> >     - acceptCount?
> >> >
> >> >
> >> > Honestly, I would rather love an exact definition of what each
> >> of those
> >> > would do to the tomcat server if tweaked.  Knowing that would be
> >> nirvana
> >> for
> >> > tuning.
> >> >
> >> >
> >> >
> >> > -j
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To start a new topic, e-mail: users@tomcat.apache.org
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (Darwin)
>
> iD8DBQFF1NaFW126qUNSzvURAuxZAJ4ugkLObXKHJZsSIfX3SWzZzv5vlQCdHXeV
> jSPVOQqZXoxvlQc7Q94vMlA=
> =YSSz
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Performance tuning parameters

Posted by Andrew Miehs <an...@2sheds.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear J'

What do you mean you are hitting connection limits?! Are you getting  
errors? What are you seeing that makes you think that is slow?
Is there a database involved in this application?

I assume you are running linux on your server, with a 2.6 kernel.

run the following commands while your box

1)  ps auxH
2)  ps auxH |grep -c java
3)  vmstat 5 5
4)  iostat 5 3

Then we will have a bit of an idea what is going on.

Andrew




On 15/02/2007, at 9:36 PM, j r wrote:

> The reason it is hitting its limits is easy: traffic.  We easily  
> get enough
> website traffic to overflow the connection limits unless I have  
> many boxes
> available to serve.  I know these can be configured to handle more
> connections.  I know that we should be able to do this in the tomcat
> server.  That is why I need those tweaking parameters defined.
>
>
>
> Thanks,
> j
>
> On 2/15/07, Leon Rosenberg <ro...@googlemail.com> wrote:
>>
>> First you should investigate why tomcat is hitting its limits.
>> Why do you think it does? Which resource is the limit?
>> Do you have/use any monitoring software? moskito? lambdaprobe?
>> tomcat-manager?
>>
>> regards
>> Leon
>>
>> On 2/15/07, j r <jr...@gmail.com> wrote:
>> > I have searched for exact documentation on this, and I always find
>> > conflicting info.  Therefore I am reaching out to this list.  I  
>> have the
>> > following info and questions:
>> >
>> > - we are running tomcat 5.5.20
>> > - we have the following configs in server.xml:
>> >            <Connector port="8009"
>> >                enableLookups="false" redirectPort="8443" debug="0"
>> >                maxThreads="750" minSpareThreads="100"
>> maxSpareThreads="250"
>> >                acceptCount="100" connectionTimeout="5000"
>> > tomcatAuthentication="
>> >                false"
>> >
>> > - we have extra capacity (mem, cpu, etc.) on the servers, yet  
>> tomcat is
>> > hitting connection limits
>> > - we feel that tomcat can serve more, so what do we tune to make  
>> it do
>> so?
>> >     - maxThreads?
>> >     - minSpareThreads?
>> >     - maxSpareThreads?
>> >     - acceptCount?
>> >
>> >
>> > Honestly, I would rather love an exact definition of what each  
>> of those
>> > would do to the tomcat server if tweaked.  Knowing that would be  
>> nirvana
>> for
>> > tuning.
>> >
>> >
>> >
>> > -j
>> >
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFF1NaFW126qUNSzvURAuxZAJ4ugkLObXKHJZsSIfX3SWzZzv5vlQCdHXeV
jSPVOQqZXoxvlQc7Q94vMlA=
=YSSz
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Performance tuning parameters

Posted by j r <jr...@gmail.com>.
The reason it is hitting its limits is easy: traffic.  We easily get enough
website traffic to overflow the connection limits unless I have many boxes
available to serve.  I know these can be configured to handle more
connections.  I know that we should be able to do this in the tomcat
server.  That is why I need those tweaking parameters defined.



Thanks,
j

On 2/15/07, Leon Rosenberg <ro...@googlemail.com> wrote:
>
> First you should investigate why tomcat is hitting its limits.
> Why do you think it does? Which resource is the limit?
> Do you have/use any monitoring software? moskito? lambdaprobe?
> tomcat-manager?
>
> regards
> Leon
>
> On 2/15/07, j r <jr...@gmail.com> wrote:
> > I have searched for exact documentation on this, and I always find
> > conflicting info.  Therefore I am reaching out to this list.  I have the
> > following info and questions:
> >
> > - we are running tomcat 5.5.20
> > - we have the following configs in server.xml:
> >            <Connector port="8009"
> >                enableLookups="false" redirectPort="8443" debug="0"
> >                maxThreads="750" minSpareThreads="100"
> maxSpareThreads="250"
> >                acceptCount="100" connectionTimeout="5000"
> > tomcatAuthentication="
> >                false"
> >
> > - we have extra capacity (mem, cpu, etc.) on the servers, yet tomcat is
> > hitting connection limits
> > - we feel that tomcat can serve more, so what do we tune to make it do
> so?
> >     - maxThreads?
> >     - minSpareThreads?
> >     - maxSpareThreads?
> >     - acceptCount?
> >
> >
> > Honestly, I would rather love an exact definition of what each of those
> > would do to the tomcat server if tweaked.  Knowing that would be nirvana
> for
> > tuning.
> >
> >
> >
> > -j
> >
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Performance tuning parameters

Posted by Leon Rosenberg <ro...@googlemail.com>.
First you should investigate why tomcat is hitting its limits.
Why do you think it does? Which resource is the limit?
Do you have/use any monitoring software? moskito? lambdaprobe? tomcat-manager?

regards
Leon

On 2/15/07, j r <jr...@gmail.com> wrote:
> I have searched for exact documentation on this, and I always find
> conflicting info.  Therefore I am reaching out to this list.  I have the
> following info and questions:
>
> - we are running tomcat 5.5.20
> - we have the following configs in server.xml:
>            <Connector port="8009"
>                enableLookups="false" redirectPort="8443" debug="0"
>                maxThreads="750" minSpareThreads="100" maxSpareThreads="250"
>                acceptCount="100" connectionTimeout="5000"
> tomcatAuthentication="
>                false"
>
> - we have extra capacity (mem, cpu, etc.) on the servers, yet tomcat is
> hitting connection limits
> - we feel that tomcat can serve more, so what do we tune to make it do so?
>     - maxThreads?
>     - minSpareThreads?
>     - maxSpareThreads?
>     - acceptCount?
>
>
> Honestly, I would rather love an exact definition of what each of those
> would do to the tomcat server if tweaked.  Knowing that would be nirvana for
> tuning.
>
>
>
> -j
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org