how are concurrent requests handled in PHP (using - threads, thread pool or child processes)

前端 未结 3 1297
梦谈多话
梦谈多话 2021-02-11 17:32

I understand that PHP supports handling multiple concurrent connections and depending on server it can be configured as mentioned in this answer

How does server manages

3条回答
  •  有刺的猬
    2021-02-11 18:03

    I think the answer depends on how the web server and the cgi deploy.

    In my company, we use Nginx as the web server and php-fpm as cgi, so the concurrent request is handled as process by php-fpm, not thread.

    We configure the max number of process, and each request is handled by a single php process, if more requests(larger than the max number of process) come , they wait.

    So, I believe PHP itself can support all of them, but how to use it, that depends.

提交回复
热议问题