Php

lighttpd:後端超載 + fcgi-server 重新啟用 + 所有處理程序都已關閉

  • October 15, 2012

我們有一個使用 PHP-CGI 的標準 lighttpd 部署,我們的錯誤日誌充滿了以下內容。這導致了一個巨大的問題,因為我們不斷地向我們的客戶退還 500 個:

2012-10-14 14:28:38: (mod_fastcgi.c.3001) backend is overloaded; we'll disable it for 1 seconds and send the request to another backend instead: reconnects: 0 load: 36 
2012-10-14 14:28:38: (mod_fastcgi.c.2764) fcgi-server re-enabled:  0 /tmp/php-7735.socket 
2012-10-14 14:28:39: (mod_fastcgi.c.2764) fcgi-server re-enabled:  0 /tmp/php-7735.socket 
2012-10-14 14:28:40: (mod_fastcgi.c.3001) backend is overloaded; we'll disable it for 1 seconds and send the request to another backend instead: reconnects: 0 load: 37 
2012-10-14 14:28:40: (mod_fastcgi.c.2764) fcgi-server re-enabled:  0 /tmp/php-7735.socket 
2012-10-14 14:28:41: (mod_fastcgi.c.3001) backend is overloaded; we'll disable it for 1 seconds and send the request to another backend instead: reconnects: 0 load: 57 
2012-10-14 14:28:41: (mod_fastcgi.c.3001) backend is overloaded; we'll disable it for 1 seconds and send the request to another backend instead: reconnects: 0 load: 57 
2012-10-14 14:28:42: (mod_fastcgi.c.3597) all handlers for /index.php? on .php are down. 

有沒有人知道發生了什麼?我們重新啟動了所有 php 和 lighttpd 相關的程序,但這並沒有解決問題。我們最終重新啟動了整個盒子,現在它消失了,儘管我們擔心它可能會在以後回來……

總的來說,我們的部署已經執行了很長時間,這是第一次發生這種情況。

這基本上意味著所有的 php 程序都在忙於處理請求,沒有空閒的 php 程序可以用來處理新的傳入請求。這會導致 500 錯誤。

通常這意味著您正在執行的 php 程式碼很慢,淹沒了 php 程序。嘗試啟用您的 mysql 慢日誌以查看慢查詢是否是罪魁禍首,嘗試使用 php 操作碼記憶體(例如 APC)來加快速度。

引用自:https://serverfault.com/questions/438332