File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes tomcat maxthread count and minspare thread count on tomcat 6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat maxthread count and minspare thread count on tomcat 6.0" Watch "tomcat maxthread count and minspare thread count on tomcat 6.0" New topic
Author

tomcat maxthread count and minspare thread count on tomcat 6.0

jamshaid ali
Greenhorn

Joined: Aug 28, 2009
Posts: 10
Well i am trying to configure tomcat 6 so that it can handle higher tps.One i wanted to how much max possible tps one can achieve on tomcat..
We are load testing our webserver configuration but it always shows 25 tps at max .. i thought one reason would be the minspare thread count default set to
25 ........so i changed and used the executor with increased minSpareThreads but no performance.........please see below:

<Service name="Catalina">

<!--The connectors can use a shared executor, you can define one or more named thread pools-->

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="300" minSpareThreads="100" maxIdleTime="120000" />

<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1"
connectionTimeout="120000"
redirectPort="8443" />


I have tried increasing acceptcount to 100 but no increase in tps wat so ever..... now have one 1GB connection ethernet connection ... we use hp load runner ....
8 GB of ram .. increased heap size to 1GB.... dual core machines ................
i cannot understand where i am going wrong......................

Wil using the nio connector help .... and how can we use the nio connector .......we have redhat linux..........
can anyone share configuration for a high end server . I need to configure it so that web server has tps around 1000.........

after configuration i restart the sytem ... but i dont think minspare thread things is working .. please if anyone answers take a minute and share the configuration xml.


james cal
Greenhorn

Joined: Sep 25, 2009
Posts: 2
You want to reach 1000 TPS serving what? Static webpages? JSP pages? How are you generating the load? What kind of system is this running on?
What's your CPU utilization? What does a thread dump show is going on? Do you have enough RAM to support that large a heap without paging?
give us these answers, may be we can find soln for you
jamshaid ali
Greenhorn

Joined: Aug 28, 2009
Posts: 10
james cal wrote:You want to reach 1000 TPS serving what? Static webpages? JSP pages? How are you generating the load? What kind of system is this running on?
What's your CPU utilization? What does a thread dump show is going on? Do you have enough RAM to support that large a heap without paging?
give us these answers, may be we can find soln for you


Thanks you replied....

Welll we have 8GB of ram and core 2 duo system serving static pages.
We cannot achieve more than 25 requests at one time.Even with a html
page simple returining 1 and doing nothing else.
I have increased accept count ,minsparethread count, but no success
About thread dump i dont know please explain i would be very thankful.


I have not used nio connector , the default one.
i have played with accept count , minSparethread count,
maxThread count ..i have read the whole documentation time and again .
Increased heap size to 1 GB .

Would appreciate a prompt reply , consider we are serving a page with nothing just
displaying helloworld
....
waiting for your response...thanks for your response i had lost hope
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
Consider the possibility that it is your network limiting the throughput, not Tomcat processing.

I would be looking at CPU utilization and network traffic to decide.

If it is the network, consider compressing the output.

Bill
jamshaid ali
Greenhorn

Joined: Aug 28, 2009
Posts: 10
William Brogden wrote:Consider the possibility that it is your network limiting the throughput, not Tomcat processing.

I would be looking at CPU utilization and network traffic to decide.

If it is the network, consider compressing the output.

Bill


Well we have IGB ethernet connection more so we have conducted load testing using HP load runner and network does not
seem to be the case.
Can you please shared configurations for a high load server .
Network is not the case.It wont accept more than 25 connection at a given time.
And by default minsparethread count is 25 i am not sure if that is the issue
i have increased it to but no success.
And please share real settings in xml please check my earlier post and recommend changes
i would really appreciate
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
You still have not looked at CPU utilization - if your CPU is nearly all tied up processing 25 requests then adding more Threads wont help.

Try using JAmon - open source and free and easy to get started with to determine exactly what part of your application is limiting throughput.

Bill
jamshaid ali
Greenhorn

Joined: Aug 28, 2009
Posts: 10
William Brogden wrote:You still have not looked at CPU utilization - if your CPU is nearly all tied up processing 25 requests then adding more Threads wont help.

Try using JAmon - open source and free and easy to get started with to determine exactly what part of your application is limiting throughput.

Bill


Well CPU utilization is not the issue at hand,as i told you we have conducted load testing using HP load runner.No network or cpu utilization issue.
Is it not possible that you share settings for a high load server.And in general with good CPU and RAM how many static pages request tomcat can handle at maximum.
Would running multiple instances of tomcat help ?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
Exactly how have you arrived at the conclusion that CPU utilization is not the problem and that there is some magic setting for Threads which is some sort of secret?

Exactly how do requests reach Tomcat? Are there proxy or security filters which requests go through? OR - Shudder - is there an Apache web server front end?

Bill
jamshaid ali
Greenhorn

Joined: Aug 28, 2009
Posts: 10
William Brogden wrote:Exactly how have you arrived at the conclusion that CPU utilization is not the problem and that there is some magic setting for Threads which is some sort of secret?

Exactly how do requests reach Tomcat? Are there proxy or security filters which requests go through? OR - Shudder - is there an Apache web server front end?

Bill


We have tomcat apache running.We tested using HP load runner and monitored CPU utilization and it went max to 40 percent.I will setup JAMON and test.
Its a simple page that simply returns 1.Its cached.DNS looks up are disabled.Thanks for your help.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
We have tomcat apache running.


That does not quite answer my question - how do requests reach tomcat? Is there an Apache web server front-end that forwards to Tomcat? Are there proxy or other services between Tomcat and the HP load runner client?

Bill
jamshaid ali
Greenhorn

Joined: Aug 28, 2009
Posts: 10
William Brogden wrote:
We have tomcat apache running.


That does not quite answer my question - how do requests reach tomcat? Is there an Apache web server front-end that forwards to Tomcat? Are there proxy or other services between Tomcat and the HP load runner client?

Bill



We have simple tomcat installed.We have a webservice that hp load runner uses to hit the web server. I hope i have answered the question i dont know much as i am new to this....
james cal
Greenhorn

Joined: Sep 25, 2009
Posts: 2
ok Jamshaid
can you please tell whats your CPU configuration at client side means how many CPU's you are using at client side(you have one CPU doing this or more than one)
your tomcat server is also on client machine or its running on a dedicated machine/server?
jamshaid ali
Greenhorn

Joined: Aug 28, 2009
Posts: 10
james cal wrote:ok Jamshaid
can you please tell whats your CPU configuration at client side means how many CPU's you are using at client side(you have one CPU doing this or more than one)
your tomcat server is also on client machine or its running on a dedicated machine/server?


Well i checked and confirmed its a quad core 2.4 GHz , 8 GB ram..... no we dont have a dedicated machine.We have a machine on which we have a web server and other progarammes running .. two perl scripts and some jsps.CPU utilization never goes up so that is not an issue.... We do invoke cgi alot......consider we hava folder with 1000 requests in each folder and we have ten of them .. we run perl scripts and for of each of the requests and in those we call jsps that connect to oracle database .We use connection pooling.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
We have a machine on which we have a web server and other progarammes running


Now - how do requests reach Tomcat? Is this an Apache web server which forwards certain request URLs to Tomcat - OR - do requests go directly to Tomcat.

Which port is Tomcat listening on?
What is the URL which your load test calls?

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat maxthread count and minspare thread count on tomcat 6.0