Common parameter setting frame

A, Tomcat parameter settings
to optimize start-line arguments: -server: Enable server version of jdk; -Xms: Minimum heap memory when the virtual machine initialization; -Xmx: maximum heap memory virtual machine can be used; -Xmn: the young generation , the young generation throughout the heap size = size + size + old generation of permanent generation size (Sun official recommended configuration for the entire heap 3/8); - Xss: refers to the set stack size for each thread, generally difficult to set up than 1M; -XX: + AggressiveOpts: use the latest optimization technology to join; -XX: + UseBiasedLocking: optimized to enable a thread-locking, the optimized thread lock allows for optimal deployment of automatic threading within your appserver; -XX : + DisableExplicitGC: not allowed to call is displayed in the program code "System.gc ()"; - XX : MaxTenuringThreshold: setting a maximum age of garbage, set this value is an ideal value obtained by monitoring local jprofiler based on;

Xmx Xms with the value is set to two as is the optimal approach;
example: -server -Xms1400M -Xmx1400M -Xss512k -XX: + AggressiveOpts -XX: + UseBiasedLocking -XX: PermSize = 128M -XX: MaxPermSize = 256M -XX : + DisableExplicitGC -XX: MaxTenuringThreshold = 31 -XX: + UseConcMarkSweepGC -XX: + UseParNewGC -XX: + CMSParallelRemarkEnabled -XX: + UseCMSCompactAtFullCollection -XX: LargePageSizeInBytes = 128m -XX: + UseFastAccessorMethods -XX: + UseCMSInitiatingOccupancyOnly -Djava.awt. headless = true

After optimization: faster system response time; recovering the JVM to speed without affecting the response rate of the system; the JVM maximize memory utilization; thread minimize obstruction

Optimization of the container
URIEncoding = "UTF-8" so that the file can be parsed tomcat contain Chinese name of URL
maxSpareThreads idle state if the number of threads than the number provided, then these threads suspension, reduce the total number of threads in the pool
minSpareThreads minimum alternate number of threads, when initialization starts tomcat threads
connectionTimeout network connection timeout milliseconds
maxThreads: tomcat using threads to process each request received. This value represents the maximum number of threads that can be created Tomcat, ie, the maximum number of concurrent
acceptCount when the number of threads reaches maxThreads, subsequent requests will be placed in a queue, this acceptCount is the size of the queue, if the queue is too full, it direct Connection refuse
maxProcessors and minProcessors: multi-threaded program to help programmers write efficient maximum utilization of CPU, the idle time kept to a minimum, thereby accepting more requests
compression = "on" open compression
compressionMinSize = "2048" to enable compression output content size, there is a default 2KB
noCompressionUserAgents = "GoZilla, Traviata" for the following browsers, do not enable compression
compressableMimeType = "text / html, text / xml" compression type
HTTP compression can greatly improve the speed of browsing the site

Published 45 original articles · won praise 9 · views 30000 +

Guess you like

Origin blog.csdn.net/zhanglinlove/article/details/90138961