In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
The parameter that the Tomcat-tuned tomcat container optimizes performance control through the application's connector (Connector) is the number of threads created to process the request. Tomcat uses thread pools to accelerate response times to process requests. In Java, a thread is the path of a program when it runs, and it is a code segment that has nothing to do with other control threads in a program and can run independently. They share the same address space. Multithreading helps programmers write efficient programs with maximum CPU utilization to keep idle time to a minimum, thus accepting more requests. Take tomcat5 as an example:
MaxThreads:Tomcat uses threads to process each request received. This value represents the maximum number of threads that Tomcat can create.
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 beyond this number will not be processed.
ConnnectionTimeout: network connection timeout (in milliseconds). Setting to 0 means that you will never time out, which is a hidden danger. It can usually be set to 30000 milliseconds.
The number of threads created during minSpareThreads:Tomcat initialization.
MaxSpareThreads: once the created thread exceeds this value, Tomcat shuts down the socket thread that is no longer needed.
The best way is to set it up a few more times and test it to observe the response time and memory usage. It may vary depending on the combination of machines, operating systems, or virtual machines, and not everyone's web site traffic is the same, so there is no one-size-fits-all solution to determine the number of threads. Using the APR library in Tomcat is actually using JNI in Tomcat to read files and transfer them over the network. It can greatly improve the processing performance of Tomcat for static files, and it can also improve the processing performance of SSL if you use HTTPS mode to transfer. Generally, under Windows, you can directly download the compiled binary version of the dll library file to enable Tomcat to enable APR. It is generally recommended to copy the library file tcnative-1.dll to the bin directory of Tomcat. Under Linux, you can directly extract and install the tomcat_native.tar.gz file in the bin directory and make sure that the apr library is installed before compilation.
How can I tell if Tomcat has enabled the APR library? You can do this by looking at the startup log of Tomcat:
If APR is not enabled, there is usually one entry in the startup log:
Org.apache.coyote.http11.Http11Protocolstart
If APR is enabled, the log becomes:
Org.apache.coyote.http11.Http11AprProtocolstart
Tcnative-1.dll download address: http://tomcat.heanet.ie/native/HTTP compression can greatly improve the speed of browsing the website, its principle is that after the client requests the web page, the web page file is compressed from the server, and then downloaded to the client, and the browser of the client is responsible for decompressing and browsing. Compared with the normal browsing process HTML,CSS,Javascript,Text, it can save about 40% of the traffic. More importantly, it can compress dynamically generated web pages, including CGI, PHP,JSP,ASP,Servlet,SHTML and other output pages, and the compression efficiency is amazing.
1) compression= "on" turns on compression function
2) compressionMinSize= "2048" enables compressed output content size, which defaults to 2KB.
3) noCompressionUserAgents= "gozilla,traviata" does not enable compression for the following browsers
4) compressableMimeType= "text/html,text/xml" compression type
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.