- 52 Minutes to read
- Print
- PDF
Configuration
- 52 Minutes to read
- Print
- PDF
JVM Configuration
Memory parameters
These parameters are probably the most important ones for Tomcat, and they must be set at the JVM level through the tomcat configuration tool, or directly at console level.
The following table give the recommended values for these parameters, depending on the package selected:
JVM Parameters | Pack 1 | Pack 2 | Pack 3 | Pack 4 | Pack 5 | Pack 6 | Pack 7 | Pack 8 | Pack 9 | Pack 10 |
-XX:XMX | 2G | 4G | 10G | 21G | 21G | 47G | 63G | 63G | 63G | 94G |
-XX:XMS | 2G | 4G | 10G | 21G | 21G | 47G | 63G | 63G | 63G | 94G |
-XX:XMN | 1G | 1G | 3G | 7G | 7G | 16G | 21G | 21G | 21G | 31G |
-XX:MaxMetaspaceSize | 1G | 1G | 3G | 7G | 7G | 16G | 21G | 21G | 21G | 31G |
G1 Garbage collector
With Java 8 and more, the garbage collector G1 has overall better performance than the default (concurrent) GC.
Recommendation:
It is recommended to activate it with the following option: -XX:+UseG1GC
You can find more explanations for fine-tuning of the GC here.
Other parameters
An other option that might help to save some resources is:
-XX:+UseStringDeduplication: its actual impact might be really neglectable in most situations, it doesn't hurt to activate this option.
Tomcat Configuration
There are many options for the configuration of Tomcat, that will be found in the server.xml file in the Tomcat configuration folder.
This file is preconfigured with minimal options upon installation and it is very important to adjust the values of the parameters listed below to get the best results according to the configuration shown below.
Tomcat configuration is based on a “Connector” that can itself be related to an “Executor’”for managing a separate thread pool, as explained in the official documentation here.
Example of configuration for https
<Connector SSLEnabled="true"
port="443"
keystoreFile="C:/var/iobeya/settings/.keystore" keystorePass="iobeya"
protocol="org.apache.coyote.http11.Http11NioProtocol"
scheme="https"
secure="true"
sslProtocol="TLS"
clientAuth="false"
maxThreads="480"
minSpareThreads="24"
processorCache="720"
compression="on"
compressionMinSize="1024"
compressibleMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/vnd.ms-fontobject,application/xml,image/svg+xml,font/otf,font/ttf"/>
To go beyond the simple example above, refer to the Tomcat reference documentation, such as:
Important parameters
The most important parameters for optimization of Tomcat performances are the ones highlighted in bold in the previous example:
maxThreads: indicates how many threads can be run simultaneously, this value will change with platform sizing (see table below).
compression: in any configuration, you would activate http compression that will lower the amount of data sent over https.
compressionMinSize: It’s inefficient to compress data < 1024 bytes.
compressibleMimeType: only compress the text data, not images or binary.
Parameters table
The parameters that must be adjusted depending on the package are listed below:
Tomcat Parameters | Pack 1 | Pack 2 | Pack 3 | Pack 4 | Pack 5 | Pack 6 | Pack 7 | Pack 8 | Pack 9 | Pack 10 |
maxThreads | 200 | 200 | 200 | 200 | 200 | 200 | 480 | 480 | 480 | 720 |
minSpareThreads | 10 | 10 | 10 | 10 | 10 | 24 | 24 | 24 | 24 | 36 |
processorCache | 200 | 200 | 400 | 800 | -1 | -1 | -1 | -1 | -1 | -1 |
iObeya Configuration
In the iObeya context file for Tomcat (iobeya.xml or ROOT.xml), the important parameter to modify is maxActive and its should follow the values in the table below:
iObeya Parameters | Pack 1 | Pack 2 | Pack 3 | Pack 4 | Pack 5 | Pack 6 | Pack 7 | Pack 8 | Pack 9 | Pack 10 |
maxActive | 20 | 50 | 100 | 150 | 200 | 300 | 500 | 700 | 1000 | 1500 |
MySQL Configuration
The configuration file of MySQL (my.ini/mysql.ini or my.cnf) will be edited and the following values updated:
MySQL Parameters | Pack 1 | Pack 2 | Pack 3 | Pack 4 | Pack 5 | Pack 6 | Pack 7 | Pack 8 | Pack 9 | Pack 10 |
innodb_buffer_pool_size | 256MB | 1GB | 2GB | 5GB | 11GB | 11GB | 23GB | 46GB | 92GB | 138GB |
innodb_buffer_pool_instances | 1 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 |
Innodb_thread_concurrency | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
max_connections | 85 | 170 | 341 | 682 | 1365 | 1365 | 2730 | 5461 | 10922 | 16384 |
Global view of all parameters
| Pack 1 | Pack 2 | Pack 3 | Pack 4 | Pack 5 | Pack 6 | Pack 7 | Pack 8 | Pack 9 | Pack 10 |
Active users | <20 | >20 et <50 | 50 et <100 | >100 et <150 | >150 et <200 | >200 <300 | > 300 | > 700 | >1000 | >1500 |
Nb users | <200 | <500 | <1000 | >1000 | >1000 | >1000 | >1000 | >1000 | >1500 | >2000 |
Rooms | <=5 | < 20 | >20 et <100 | > 100 et <500 | >500 | >500 | >500 | >500 | >1000 | >1500 |
Host RAM | 4GB | 8GB | 16GB | 32GB | 32 GB | 72 GB | 96 GB | 96 GB | 96 GB | 144 GB |
Host CPUs | 2 | 2 | 4 | 8 | 16 | 36 | 48 | 48 | 48 | 72 |
DB vCPUs | 2 | 2 | 2 | 2 | 4 | 4 | 8 | 16 | 32 | 48 |
DB RAM | 1 | 2 | 4 | 8 | 16 | 16 | 32 | 64 | 128 | 192 |
-XX:XMX | 2G | 4G | 10G | 21G | 21G | 47G | 63G | 63G | 63G | 94G |
-XX:XMS | 2G | 4G | 10G | 21G | 21G | 47G | 63G | 63G | 63G | 94G |
-XX:XMN | 1G | 1G | 3G | 7G | 7G | 16G | 21G | 21G | 21G | 31G |
-XX:MaxMetaspaceSize | 1G | 1G | 3G | 7G | 7G | 16G | 21G | 21G | 21G | 31G |
maxThreads | 200 | 200 | 200 | 200 | 200 | 200 | 480 | 480 | 480 | 720 |
minSpareThreads | 10 | 10 | 10 | 10 | 10 | 24 | 24 | 24 | 24 | 36 |
processorCache | 200 | 200 | 400 | 800 | -1 | -1 | -1 | -1 | -1 | -1 |
maxActive | 20 | 50 | 100 | 150 | 200 | 300 | 500 | 700 | 1000 | 1500 |
innodb_buffer_pool_size | 256MB | 1GB | 2GB | 5GB | 11GB | 11GB | 23GB | 46GB | 92GB | 138GB |
innodb_buffer_pool_instances | 1 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 |
Innodb_thread_concurrency | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
max_connections | 85 | 170 | 341 | 682 | 1365 | 1365 | 2730 | 5461 | 10922 | 16384 |