Page 1 of 1

connect() & recv() failed

Posted: Mon Feb 06, 2017 1:06 pm
by Hruhoriy
Hello.
Work CentOS 6.8 and Vesta 0.9.8 (x86_64)/17
Used Apache + Nginx
And a lot of errors in the logs:

Code: Select all

connect() failed (111: Connection refused) while connecting to upstream
recv() failed (104: Connection reset by peer) while reading response header from upstream
How to fix?

Re: connect() & recv() failed

Posted: Thu Feb 09, 2017 1:51 pm
by skurudo
It seems your Apache is more busy than your Nginx. When Nginx get some requests but Apache can't handle, you get '502 Bad Gateway', which meas Apache refused to work for Nginx.

Try decrease 'worker_connections' and 'worker_processes' in Nginx and increase 'MaxClients', 'ServerLimit'

Make sure worker_connections * worker_processes < MaxClients < ServerLimit

PS: I guess, it's more like resource like problem.