日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php fast cgi nginx,通过fast-cgi连接php-fpm和nginx之间的连接是持...

發布時間:2024/7/23 php 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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之间的连接是持...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。