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 > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Apache prefork model:
Pre-derived mode, there is a main control process, and then generate multiple child processes, using the select model, the maximum concurrency of 1024, each child process has an independent thread to respond to user requests, relatively occupied memory, but relatively stable, you can set the maximum and minimum number of processes, is the oldest mode, but also the most stable mode, suitable for access is not very large scenes. Advantages: Stable Disadvantages: A large number of users access slowly, occupying resources, 1024 processes are not suitable for high concurrency scenarios
Apache Woker Model:
A multi-process and multi-threaded hybrid model, there is a control process, start multiple child processes, each child process contains fixed threads, use threads to process requests, when the thread is not enough to use a new child process, and then start threads inside the process to process requests, because it uses threads to process requests, so it can withstand higher concurrency. Advantages: Compared to prefork, it takes less memory and can handle more requests at the same time. Missing points: With keepalive's long connection mode, a thread will always be occupied, even if there is no data transfer, it will have to wait until the timeout is released. If too many threads are occupied in this way, it will also result in no service threads available in high concurrency scenarios. (This problem occurs in prefork mode.)
Apache event model:
Apache's latest pattern, apache 2.4.X series released in 2012 officially supports the event model, belongs to the event-driven model (epoll), each process responds to multiple requests, in the current version is already stable and available pattern. It is very similar to the worker pattern, the biggest difference is that it solves the problem of resource waste of threads that have been occupied for a long time in the keepalive scenario (some threads are hanging there because they are keepalive, almost no requests come in the middle, and even wait until timeout). In event MPM, there will be a dedicated thread to manage these keepalive threads. When there is a real request, the request will be passed to the service thread, and after execution, it will be allowed to release. This enhances request handling in high concurrency scenarios. Advantages: Single thread responds to multiple requests, occupies less memory, performs better under high concurrency, there will be a dedicated thread to manage keep-alive threads, when there is a real request, the request will be passed to the service thread, after execution, it is allowed to release Disadvantages: No thread safety control
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.