First, the most important thing is to install 64-bit Ubuntu, so that the memory limit of a single process is gone. 1. file handle. The default value is 1024, and the value is changed to 65535. $ Sudovi/etc/security/limits. conf: * softnofile65535 * hard & nbs
First, the most important thing is to install 64-bit Ubuntu, so that the memory limit of a single process is gone.
1. file handle. The default value is 1024, and the value is changed to 65535.
$ Sudo vi/etc/security/limits. conf
Add the following two lines:
* Soft nofile 65535
* Hard nofile 65536
After the server is restarted,
$ Ulimit-n
65535
2. tomcat's JAVA_OPTS settings. If it is a 32-bit operating system, the maximum value can be set to 1 GB. In a 64-bit operating system, it can be set to a large value.
Add a line to tomcat/bin/catalina. sh:
JAVA_OPTS = "-Xms2g-Xmx4g-XX: PermSize = 1g-XX: MaxPermSize = 2g"
3. tomcat settings.
MaxThreads = "512" minSpareThreads = "50"/>
ConnectionTimeout = "20000"
RedirectPort = "8443" URIEncoding = "UTF-8"/>