php - Connection reset by peer while reading response header from upstream every day at same time


Anyone have an idea why I get

recv() failed (104: Connection reset by peer) while reading response header from upstream

Every night at same time, it lasts 10-15 minutes then it goes away. We have plenty of visitors during the day and site works fine.

But every night at same time errors start and site becomes unresponsive. Not only that but errors in log repeat in same pattern, sometimes every 10 seconds, sometimes 20 sec.

Nginx error log is empty during that time. PHP log has this issues during that time (plenty of those, this is just one example)

[18-Jun-2015 22:20:59] NOTICE: [pool web1] child 22250 started  
[18-Jun-2015 22:21:02] WARNING: [pool web1] child 22093, script '/var/www/blabla/web/index.php' (request: "GET /index.php") execution timed out (62.994281 sec), terminating  
[18-Jun-2015 22:21:02] WARNING: [pool web1] child 22093 exited on signal 15 (SIGTERM) after 63.584813 seconds from start  
[18-Jun-2015 22:21:02] NOTICE: [pool web1] child 22262 started

If there is something wrong with my configuration why i dont get any problems during peak hours but in midnight only?

No script is starting during that time in cronjob so it is not that also...

Anyone any idea where to check or what to fix?




Not sure what is your configuration as of now, but seems like your script is timing out while performing some task,

You should consider changing the nginx config(.conf) file:

location ~ \.php$ {
  fastcgi_read_timeout  3600;///you can increase this to more




We found what the problem was. It was JotCache plugin in joomla, starting every day at the same time and doing nasty stuff in mysql.

People are also looking for solutions to the problem: php - Moodle download a created PDF


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.