Why cannot Apache handle multiple requests at the same time?

后端 未结 8 594
执笔经年
执笔经年 2021-01-31 21:23

I have AMPPS installed.

My Apache server cannot handle multiple php requests at once (for example if I call localhost/script.php multiple times, they are pr

8条回答
  •  遥遥无期
    2021-01-31 21:44

    Apache provides a variety of multi-processing modules (Apache calls these MPMs) that dictate how client requests are handled. Basically, this allows administrators to swap out its connection handling architecture easily. These are:

    1. mpm_prefork: This processing module spawns processes with a single thread each to handle request. Each child can handle a single connection at a time.
    2. mpm_worker: This module spawns processes that can each manage multiple threads. Each of these threads can handle a single connection.Since there are more threads than processes, this also means that new connections can immediately take a free thread instead of having to wait for a free process.
    3. mpm_event: This module is similar to the worker module in most situations, but is optimized to handle keep-alive connections. When using the worker MPM, a connection will hold a thread regardless of whether a request is actively being made for as long as the connection is kept alive.

提交回复
热议问题