• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat performance problem with increased no of threads

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a web application that uses Apache web server and tomcat servlet engine. I am doing performance tests using jMeter.


1) I ran a test with 150 threads(users) each sending 1 request per minute (configured in jmeter using a constant timer with value 40 secs ) and the average response time was 30secs.
2) I ran another test with 75 threads(users) each sending 2 reqs per minute ( again configured in jmeter using a constant timer with value 20 secs ) and noted that the average response time was 15 secs.

In both the tests, the throughput of the server recorded was 130 req/minute.

I am confused why there is a huge difference in the response time if i increase the number of threads, though the throughput, CPU usage heap size etc remain the same.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch.
I don't know much about Tomcat internals, but my knee jerk reaction is to blame session overhead. 150 clients will have twice the overhead 75 clients would have.
Have you tuned the number of threads your server uses? Look at the Connector configuration in server.xml, in particular maxThreads/minSpareThreads/maxSpareThreads. It looks like the defaults are 150/25/75, which means if you hit Tomcat with 150 simultaneous requests, it's got to do some work to bring up 125 new threads. That's going to impact response time. Then Tomcat is going to keep 75 of those threads around for subsequent requests (you don't tell us if you restart Tomcat between tests) so when you retest with 75 clients, Tomcat already has 75 threads ready. It should respond to those subsequent requests faster.
 
Rishi Renjith
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I kept the tests running for a whole night, so i guess the thread startup has little overhead for a long run.

I had restarted my server for both the tests, and i had changed the configuration in server.xml as follows

maxThreads=250, minSpareThreads=75

One more symptom that i see is that the classes loaded keeps increasing during the test, till it goes upto 40000 in about 3 hours even though all the threads are sending the same request. Then it comes down ( i guess garbage collection ). I am setting permMaxSize=128m, minheap=256m maxheap=512m.

I should also say that my web application processing involves a lot of XSLTC processing.
 
reply
    Bookmark Topic Watch Topic
  • New Topic