php fast cgi nginx,通过fast-cgi连接php-fpm和nginx之间的连接是持...
PHP-FPM是fastCGI協議的一種實現,因此它遵守所有fastCGI規范要求.
The Web server controls the lifetime of transport connections. The Web server can close a connection when no requests are active. Or the Web server can delegate close authority to the application (see FCGI_BEGIN_REQUEST). In this case the application closes the connection at the end of a specified request.
This flexibility accommodates a variety of application styles. Simple applications will process one request at a time and accept a new transport connection for each request. More complex applications will process concurrent requests, over one or multiple transport connections, and will keep transport connections open for long periods of time.
A simple application gets a significant performance boost by closing the transport connection when it has finished writing its response. The Web server needs to control the connection lifetime for long-lived connections.
When an application closes a connection or finds that a connection has closed, the application initiates a new connection.
這意味著由Web服務器決定連接是否會持續存在.這是通過fastcgi_keep_conn選項在nginx中實現的,該選項指出:
By default, a FastCGI server will close a connection right after sending the response. However, when this directive is set to the value on, nginx will instruct a FastCGI server to keep connections open. This is necessary, in particular, for keepalive connections to FastCGI servers to function.
此語句用于反映規范行為以及可以為fastCGI生成的內容提供服務以修改默認行為的Web服務器的功能.
我的假設是,由于網絡服務器的線程不斷被回收,因此保持連接不存在真正的意義.也許有一定數量的停放線程,但通常的線程池策略是殺死least recently used線程,通常這意味著產生一個新線程將確保預先退出的線程被殺死.
不可否認,我沒有找到任何資源來支持nginx的池收集策略是LRU的說法,但它不是不可能的,在這種情況下保持連接存活不會節省太多.
總結
以上是生活随笔為你收集整理的php fast cgi nginx,通过fast-cgi连接php-fpm和nginx之间的连接是持...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: excel插入页码_Excel里毫不起眼
- 下一篇: html4基础,HTML 基础 4