In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
How to optimize the performance of Apache server? I believe that many novice rookies have not yet learned this skill. Through the summary of this article, I hope you can learn this skill. The following materials are the steps for implementation.
Configure the website, to make full use of the system resources, drain all the potential of the system, so that the speed of the website to the extreme. Apache is an intermediate bridge between user browsing and website data. But here, although we have not done much, but if we take good care of it, some settings will have an immediate effect.
1. When installing Apache, choose MPM correctly.
To maximize the performance of Apache, the first step is to choose the right MPM.
Apache has three MPM, which are event, prefork and worker.
Among them, the MPM of event is more suitable for situations with a large number of continuous connections. The advantage of KeepAlive is that you can make multiple requests in the same TCP connection: in this way, you can speed up an HTML document that contains a large number of pictures by 50%. You can start KeepAlive by setting KeepAlive to On in the Apahce configuration file httpd.conf.
Prefork is a non-threaded MPM. Its characteristic is: although not very fast, but very stable. It can isolate each request, so if one request fails, other requests will not be affected. One of the most important parameters for using prefork is MaxClients.
This MaxClients number should be large enough to perform well during peak access times, but not so large that Apache requires more memory than physical memory.
Worker is a newly developed MPM in the Apache2 version, which is much faster than prefork. Moreover, due to the use of multi-threading for access processing, it can handle a relatively large number of requests, and the consumption of system resources is less than that of process-based servers. Worker is the main way to use Apache 2.
Worker has two important configuration parameters: ThreadsPerChild and MaxClients. ThreadsPerChild is used to control the number of threads allowed for each child process, and MaxClients is used to control the number of buses allowed to be established.
So, how to choose these three MPM?
If you need better scalability, you can choose worker or event (because they are threaded MPM); if you need better stability and compatibility (such as adapting to some older software), you can choose prefork. "from prefork to worker: modifying the ubuntu apache mode of operation"
If you are still unable to evaluate your needs and still don't know which MPM to choose, then worker is recommended.
2. Apache configuration optimization.
In Ubuntu, the main Apache configuration file is / etc/apache2/apache.conf, so let's configure it for this file.
(1) close DNS query
HostnameLookups is already set to off by default, so be sure to keep this setting. If you need to count the client DNS, you can use third-party software to do so.
(2) optimize MaxClients
When Apache2 starts, it creates some processes (the number of StartServer set in the configuration file) and maintains a maximum number of MaxClients; every connection request that exceeds that number is queued.
The above is the performance optimization method of Apache server shared by Xiaobian. If you have similar doubts, you might as well refer to the above method to try. If you want to know more about it, please follow the industry information.
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.