Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Servers > TOMCAT web server optimization

Forgot Password?
 Servers   Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 09-07-2009   #1 (permalink)
Linux User
 
bilal_jan's Avatar
 
Join Date: Mar 2008
Location: Pakistan
Posts: 260
TOMCAT web server optimization

Please consider the following details:
Scenario: We put load on tomcat (basically a simple http request) and in response an http response sends 1 to show success.

Quote:
Executor and Connector configuration (TOMCAT 6) with java version 1.4.2:

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

<Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1"
acceptCount="100"
acceptorThreadCount="2"
processCache="-1"
enableLookups=”false”
connectionTimeout="120000"
socket.tcpNoDelay="true"
redirectPort="8443" />
Now I have tried many other configurations but I think this basic configuration should work.What we eventually want is TPS around 1000.I have tried the version where we don’t use the executor and have useExecutor=”false” in connector settings and define maxthread and minspare thread count in connector.In all cases TPS seems pretty much the same. More so I have also tried using different protocol protocol=”org.apache.coyote.http11.HTTP11NioProtoc ol” as well. We have heap size increased to 1GB.

Load Testing and results:
Quote:
100 users hit once we get 23 tps at max
100 users hit thrice with no gap we get 250 tps.
But as we go to increase the number of users and not iterations we get a bottleneck of 25 tps at max and not more.As minSpareThread count is 25 by default. I thought that it may very well explain the bottleneck but increasing the minsparethread count doesn’t help at all we get same results.
__________________
Linux is basically a simple operating system, but you have to be a genious to understand the simplicaity - Dennis Ritchie
bilal_jan is offline  


Reply With Quote
Old 09-08-2009   #2 (permalink)
Linux Guru
 
coopstah13's Avatar
 
Join Date: Nov 2007
Location: NH, USA
Posts: 1,756
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?
coopstah13 is offline   Reply With Quote
Old 09-25-2009   #3 (permalink)
Linux User
 
bilal_jan's Avatar
 
Join Date: Mar 2008
Location: Pakistan
Posts: 260
thanks coopstah13 for your reply
we are generating load by sending simple http requests to our server.
we want to reach 1000 tps serving static webpages.
I am stuck here would really appreciate your help.Would be waiting for your response
__________________
Linux is basically a simple operating system, but you have to be a genious to understand the simplicaity - Dennis Ritchie
bilal_jan is offline   Reply With Quote
Old 09-25-2009   #4 (permalink)
Linux Guru
 
coopstah13's Avatar
 
Join Date: Nov 2007
Location: NH, USA
Posts: 1,756
What are you using to drive the load? It is possible that what you are using to drive the load is inadequate to reach 1000 TPS. What about the machine tomcat is running on, it is possible it is not powerful enough to serve 1000 TPS. Are you monitoring CPU utilization, disk IO rate, and other performance related things on the tomcat server?
coopstah13 is offline   Reply With Quote
Old 09-28-2009   #5 (permalink)
Linux User
 
bilal_jan's Avatar
 
Join Date: Mar 2008
Location: Pakistan
Posts: 260
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
__________________
Linux is basically a simple operating system, but you have to be a genious to understand the simplicaity - Dennis Ritchie
bilal_jan is offline   Reply With Quote
Old 09-28-2009   #6 (permalink)
Linux Guru
 
coopstah13's Avatar
 
Join Date: Nov 2007
Location: NH, USA
Posts: 1,756
I still need you to answer the questions in my previous post
coopstah13 is offline   Reply With Quote
Old 09-29-2009   #7 (permalink)
Linux User
 
bilal_jan's Avatar
 
Join Date: Mar 2008
Location: Pakistan
Posts: 260
we send a request for simple html page and server returns 1 in case of success.
Well we have 8GB of ram and core 2 duo system serving static pages.so they must achieve 1000 tps.
Well CPU utilization is not the issue at hand,as we have conducted load testing using HP load runner.No network or cpu utilization issue.
__________________
Linux is basically a simple operating system, but you have to be a genious to understand the simplicaity - Dennis Ritchie
bilal_jan is offline   Reply With Quote
Old 09-29-2009   #8 (permalink)
Linux User
 
bilal_jan's Avatar
 
Join Date: Mar 2008
Location: Pakistan
Posts: 260
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.
__________________
Linux is basically a simple operating system, but you have to be a genious to understand the simplicaity - Dennis Ritchie
bilal_jan is offline   Reply With Quote
Old 09-29-2009   #9 (permalink)
Linux User
 
bilal_jan's Avatar
 
Join Date: Mar 2008
Location: Pakistan
Posts: 260
tested tomcat with jmeter for 1000 threads with ramp up period of 20s.
gets 100%cpu,memory usage was ok
__________________
Linux is basically a simple operating system, but you have to be a genious to understand the simplicaity - Dennis Ritchie
bilal_jan is offline   Reply With Quote
Old 09-29-2009   #10 (permalink)
Linux Guru
 
coopstah13's Avatar
 
Join Date: Nov 2007
Location: NH, USA
Posts: 1,756
So you are saying that you are running a load test with jmeter and the server is CPU bound? You cannot achieve anything more once you are bound by any hardware. Once a resource is capped, particularly CPU or disk, there is nothing you can do to increase throughput except add more hardware, unless you can make modifications to your software, but this isn't the case for you since you aren't serving up a java application, you are only serving static web pages.

A 2 CPU system isn't that powerful these days. If I have time I will try to see what I can get for throughput on a 2 CPU system.

Also, I recommend watching the output of vmstat on the server. I am guessing you will see a high amount of threads in the 'r' column, which means they are waiting on the CPU.
coopstah13 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 11:34 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2