Search code examples
javaperformancetomcatjvisualvm

Tomcat org.apache.catalina.connector.requestfacade.getsession() takes more than 44.7% CPU resources


I have built a stateless java servlet web application and the requirement is to accept at least 5000 transaction per second (with 150 concurrent thread). I am using ehcache together with SQL server 2005 to avoid writing to the slow harddisk.

In the performance test (with Jmeter 150 threads), i only manage to score roughly 2800 transactions per second (less than half of expected). When i take a sampler inside the JVisualVM, i notice that:

 org.apache.catalina.connector.requestfacade.getsession()   <-- take more than 44.7% of CPU time

Any idea what does the requestfacade.getsession() doing and is there a way to speed it up? while i must optimise my code, i still need to figure out what does the above line doing else 5000 per second is practically impossible.

Tomcat conf:

-single Tomcat instance (6.0.23) -Using Connectir executor, with 150 maxThread

Server conf:

-Windows 2008

-xeon quad core

-8GB ram

-1TB raid 5 HDD

Any help is must appreciated!


Solution

  • If your servlet is truly stateless, why is it accessing the session?

    :-)