In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
The default configuration of Tomcat web page optimization Tomcat is not suitable for the production environment, it will frequently appear false death phenomenon and need to be restarted. Only through continuous stress test optimization can it run stably and efficiently. There are three main aspects of optimization, including operating system optimization (kernel parameter optimization), Tomcat profile parameter optimization, Java virtual machine (JVM) tuning. One of the most difficult to understand is jvm tuning. System optimization is not introduced in this chapter. This chapter will compare the data before and after tuning with the jmeter stress test tool. The Tomcat profile parameter optimizes [maxThreads] Tomcat uses threads to process each request received, which represents the maximum number of threads that Tomcat can create, with a default value of 200. [minSpareThreads] minimum number of idle threads, the number of threads initialized when Tomcat starts, indicating that there are so many empty threads waiting even if no one is using them. The default value is 10 [maxSpareThreads] the maximum number of standby threads. Once the created threads exceed this value, Tomcat will shut down socket threads that are no longer needed. The default value is-1 (unlimited). Generally, you do not need to specify [URIEncoding] to specify the URL encoding format of the Tomcat container. The language encoding format is not as convenient as other Web server software configuration. You need to specify [connnectionTimeout] network connection timeout respectively, in milliseconds. Setting it to 0 means never timeout. This setting has hidden dangers. Usually, by default, you can [enableLookups] check the domain name in 20000 milliseconds to return the hostname of the remote host. The value is true or false. If set to false, the IP address is returned directly. In order to improve the processing power, it should be set to false. [disableUploadTimeout] whether to use timeout mechanism when uploading. Should be set to true. [connectionUploadTimeout] upload timeout. After all, file upload may take more time. Adjust this according to your own business needs, so that Servlet has a longer time to complete its execution. You need to use it with the previous parameter to take effect. [acceptCount] specify the maximum queue length that can be passed in connection requests when all available threads for processing requests are used. Requests exceeding this number will not be processed. The default is 100. [compression] whether to perform GZIP compression on the response data. Off: disable compression. On: compression is allowed (text will be compressed), force: compression is carried out in all cases. The default value is off. After compressing the data, the page size can be effectively reduced. Generally, the size of the page can be reduced by about 1 compressionMinSize. Saving bandwidth [compressionMinSize] indicates the minimum value of the compression response. The message will be compressed only when the response message size is greater than this value. If the compression function is enabled, the message will be compressed. The default value is the 2048 [compressableMimeType] compression type, which specifies which types of files are compressed.
[noCompressionUserAgents= "gozilla, traviata"] Compression is not enabled for the following browsers
Note that if the code has been separated, static pages and images and other data do not need to be processed by Tomcat, then there is no need to configure compression in Tomcat. Because there is only one Tomcat server here, and the pressure test is the home page of Tomcat, there will be pictures and static resource files, so here we first test the web page stress test results in the client before enabling compression configuration instance optimization to start a win 10 virtual machine. Now the Java environment is installed and configured in the virtual machine, and the stress test tool is run based on the Java environment.
Drag the stress test tools and script files into the virtual machine, and perform the pressure test operation
Optimize the configuration [root@localhost conf] # vim server.xml / / Edit the tomcat configuration file. / / omit some of the contents.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.