Technical Articles
How to optimize Tomcat server utilization.
I write this article is aiming to help you understand how to ameliorate your Tomcat performance.
I’m going to write it as simple as possible so that you can understand what I’m talking about even with a glance.
Unlike other technical articles, you won’t be lost in a terminological jungle. Instead, you will stand on the top of a mountain so that you can see the full landscape of this field.
To make a long story short, let’s begin with a example below:
You could image Tomcat is a bottle, if you want to put more water into it and pour the water out as fast as possible within certain seconds, there are two factors that you need to consider:
- The size of bottle neck.
- The volume of the bottle itself.
So equally, tuning a Tomcat server, you could only focus on two factors.
- Connector. –> The bottle neck, defined in server.xml.
- JVM(Max Memory Pool). –> The volume, defined in Java Options.
To increase the bottle neck size, go to /conf/server.xml.
First, uncomment the following line to tell the system that you are going to use self-defined executor(Executor is the guard of connector). By default, executor is disabled.
For executor and connector definitions, please go to https://blogs.sap.com/2019/07/18/how-to-get-a-quick-overview-on-tomcat-related-words/ for details.
Note: Generally, maxThreads=”500″ minSpareThreads=”20″ maxIdleTime=”60000″ are enough.
<Executor name=”tomcatThreadPool” namePrefix=”catalina-exec-” maxThreads=”500″ minSpareThreads=”20″ maxIdleTime=”60000″ />
Then, change connection timeout value like the following example.
<Connector executor=”tomcatThreadPool” port=”8080″ protocol=”HTTP/1.1″ connectionTimeout=”60000″ keepAliveTimeout=”15000″ maxKeepAliveRequests=”1″ redirectPort=”8443″ />
To increase the bottle volume, you can check the following two KBs due to OS type accordingly.
- Windows: 1921501 – Default Java Options for Tomcat for BI4
- Linux/AIX: 1750952 – BI4 Setting JAVA_OPTS for tomcat
Concerning the proper JVM size, please go to the following KB to know the details.
2405536 – Best Practice: The popular combinations of Tomcat Max Memory Pool size and MaxPermSize .
Thank you John!!!
Would you use an executor on SSL enabled connectors?
It should no problem at all to use executor on SSL enabled connectors.
It's just a thread pool.
Hi John, I've set up a Tomcat Server to run a few web services. What do I have to do to allow the Tomcat Server to be set up as the Target Host in SM59. Hopefully not too off subject. Kind regards Graham
Hi Graham,
I suppose SM59 is the transaction code of ABAP system. If I'm right, please let me clarify one thing.
This Tomcat article is only related to Tomcat performance tuning, but not related to combination with other systems. Moreover, since I'm not familiar with SM59, so I'm afraid that I can not guide you through that configuration.
Sincerely,
John
Could you advise how to increase the memory pool for Tomcat 9 for BO 4.3 SP1 version.
Ours is windows 2016 server in cluster environment with 01 and 02 server
01- 64 bit ram
02- 64 bit ram
Daily 300-400 users login and 700 reports are run
Hi Satyabati Bhotra,
According to KB 2405536 – Best Practice: The popular combinations of Tomcat Max Memory Pool size and MaxPermSize, I suggest you can setup 12GB as JVM max memory pool size in each Tomcat server. Then it should be 24 GB in total.
In theory, it should fulfill your business demands.
Sincerely,
John
SAP Product Support