In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about the working principle of apache, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it with the editor.
How prefork works
A separate control process (parent) is responsible for generating child processes that are used to listen to requests and respond.
Apache always tries to keep some spare or idle child processes for upcoming requests. In this way, the client does not have to wait for the child process to be generated before it is served. In Unix systems, the parent process usually runs as root to secure port 80, while the child process generated by Apache usually runs as a low-privileged user.
The User and Group directives are used to configure low-privileged users of child processes. The user running the child process must have read access to the content he serves, but must have as few permissions as possible to resources other than the service content.
How worker works
The number of threads that each process can have is fixed. The server increases or decreases the number of processes depending on the load.
A separate control process (parent process) is responsible for the establishment of child processes. Each child process can establish a number of ThreadsPerChild service threads and a listening thread, which listens for access requests and passes them to the service thread for processing and response. Apache always tries to maintain a spare or idle pool of service threads.
In this way, the client can be processed without waiting for a new thread or process to be established. In Unix, in order to bind port 80, the parent process is usually started as root, and then Apache sets up child processes and threads with lower-privileged users. The User and Group directives are used to configure permissions for Apache child processes. Although the child process must have read access to the content it provides, it should be given as few privileges as possible.
In addition, unless suexec is used, the permissions configured by these directives are inherited by the CGI script.
Event MPM
This is the latest working mode of Apache, and it is very similar to worker mode, except that it solves the problem that thread resources are wasted when keep-alive persistent connections are made. In event working mode, there are some special threads used to manage these keep-alive type threads. When a real request comes, it passes the request to the thread of the server, and then allows it to be released after execution.
This enhances request processing in high concurrency scenarios. This pattern is used in the version of apache2.4 in unix systems.
The above is the introduction of the working principle of apache, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.