nginx errors readv() and recv() failed

rampr picture rampr · Nov 14, 2009 · Viewed 43.1k times · Source

I use nginx along with fastcgi. I see a lot of the following errors in the error logs

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

I don't see any problem using the application. Are these errors serious or how to get rid of them.

Answer

rampr picture rampr · Dec 6, 2009

I was using php-fpm in the background and slow scripts were getting killed after a said timeout because it was configured that way. Thus, scripts taking longer than a specified time would get killed and nginx would report a recv or readv error as the connection is closed from the php-fpm engine/process.