Forum: NGINX proxy_connect_timeout maximum

2974d09ac2541e892966b762aad84943?d=identicon&s=25 lspasam (Guest)
on 2014-08-29 20:07
(Received via mailing list)
Hello,
I am receiving "upstream timed out (110: Connection timed out) while
connecting to upstream, client" errors. They are comet calls and I
wonder if
increasing the proxy_connect_timeout will help.   i have increased
proxy_send_timeout and proxy_read_timeout to 6000 and have turned off
proxy_buffering.  The docs say that the proxy_connect_timeout cannot
"usually" exceed 75s.  All my searches regarding nginx and comet return
config files that have proxy_connect_timeout values exceeding 75s.  Is
there
a max value for this?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,252948,252948#msg-252948
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2014-08-31 03:31
(Received via mailing list)
Hello!

On Fri, Aug 29, 2014 at 02:07:05PM -0400, lspasam wrote:

> Hello,
> I am receiving "upstream timed out (110: Connection timed out) while
> connecting to upstream, client" errors. They are comet calls and I wonder if
> increasing the proxy_connect_timeout will help.   i have increased

Unlikely.  The default is 60 seconds, and it's enough for TCP
3-way handshake even in case of very distant servers.  If a
handshake can't complete within 60 seconds, it means that there is
something wrong with your backend server - e.g. the server is
overloaded and can't accept new connections.

> proxy_send_timeout and proxy_read_timeout to 6000 and have turned off
> proxy_buffering.  The docs say that the proxy_connect_timeout cannot
> "usually" exceed 75s.  All my searches regarding nginx and comet return
> config files that have proxy_connect_timeout values exceeding 75s.  Is there
> a max value for this?

Maximum value for proxy_connect_timeout is determined by OS
settings.  Under traditional BSD it's 75s, and on FreeBSD it can
be changed using the net.inet.tcp.keepinit sysctl.  On modern
Linuxes the default seems to be 20s, and should be possible to
change it by setting retry count in net.ipv4.tcp_syn_retries.

As previously noted though, it's highly unlikely that changing this
will help.  You should look into what happens with your backend
instead.

--
Maxim Dounin
http://nginx.org/
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.