Tomcat and Nginx tuning and configuration

Nginx tuning and configuration
Static resource configuration: set the location parameter, configure the matching rules, which static resources are matched, and then set the path. location ~ .*.(gif|jpg|jpeg|png)$ { Optimization of the number of processes: If the server performance is better, you can set a larger number to improve the efficiency of Nginx. worker_processes 8 timeout time: set the timeout time, the default is 60s, Nginx will automatically kick out the timeout connection to maintain availability. keepalive_timeout 90;

Tomcat tuning and configuration
Maximum number of threads maxThreads: Tomcat uses threads to process each request it receives. This value represents the maximum number of threads that Tomcat can create.
The maximum accessible number acceptCount: Specifies the number of requests that can be placed in the processing queue when all available threads for processing requests are used, and requests exceeding this number will not be processed.
Network connection timeout connectionTimeout: unit: milliseconds. Setting it to 0 means never timeout, which is a hidden danger. Usually can be set to 30000 milliseconds.
The number of threads created when Tomcat is initialized minSpareThreads:
The maximum number of idle threads: maxSpareThreads: Once the created thread exceeds this value, Tomcat will close the socket thread that is no longer needed Network
protocol protocol: Four kinds of BIO NIO NIO2 APR Apache Portable Runtime
https:/ /tomcat.apache.org/tomcat-8.0-doc/config/http.html. https://tomcat.apache.org/tomcat-8.0-doc/apr.html

Guess you like

Origin blog.csdn.net/lx9876lx/article/details/120620631