Random PHP FastCGI / Connection reset by peer / incomplete headers

前端 未结 2 1601
耶瑟儿~
耶瑟儿~ 2021-02-05 21:34

I\'ve been having random 500 Internal Server errors on my PHP / MySQL based sites on various shared hosts. I\'m using PHP 5.2.17 through CGI/FastCGI on a shared Lin

2条回答
  •  迷失自我
    2021-02-05 21:58

    for anyone looking for more info:

    in my case, there was a code issue. On an incoming http request, a call to an internal URL was being made from within the code thereby creating a deadlock kind of situation.

    This resulted in hung PHP processes and brought the server down. we were using file_get_contents('URL') or cURL() in our callback function. We then replaced it with an simple drupal function which provided us the values from DB.

    The NewRelic tool helped me identify the function which was taking a lot of time to respond.

    Another way to identify this would have been to do a drupal_watchdog on our callback function and verify the logs when the server crashed.

    hope this helps.

提交回复
热议问题