Nginx +PHP-fastcgi 502頻繁報錯的解決辦法(轉)

來源:互聯網
上載者:User

原帖:http://hily.me/blog/2010/02/nginx-php-fpm-resouce-temporarily-unavailable/

今天在測試伺服器上搭了 Nginx + PHP-FPM 的環境,結果發現 PHP 頁面頻繁出現 502 Bad Gateway 錯誤。
Nginx 版本:nginx/0.7.61
PHP-FPM:php-5.3.0-fpm-0.5.12
Nginx 錯誤記錄檔:

connect() to unix:/tmp/php-fpm.socket failed (11: Resource temporarily unavailable) while connecting to upstream

看起來似乎是 PHP-FPM 的問題,看老外的討論:

http://forum.nginx.org/read.php?3,31467,31467

原因是 PHP-FPM 在 backlog 設定為 -1 的情況下,並沒有使用系統的 backlog 設定。
所以我們需要顯式指定 backlog 參數。

把 PHP-FPM 設定檔中的:

<value name="backlog">-1</value>

改成:

<value name="backlog">1024</value>

問題消除。

-- EOF --

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.