Welcome! Log In Create A New Profile

Advanced

Re: upstream prematurely closes cnx => 502 Bad Gateway to client

March 04, 2016 08:38AM
I've also seen the issue when running plain nginx 1.9.11 sort like builting a new nginx, only the issue is that upstream closes cnxs, not nginx.
Since I've discovered that our TCs had the Connector' keepAliveTimeout way low (10 msec), mistakenly thought the units were sec and not as actually msec.
Since increasing this a 1000 fold everything seems much better now :)

<Connector port="8081" protocol="HTTP/1.1"
maxConnections="8192" maxThreads="200"
enableLookups="false" tcpNoDelay="true"
connectionTimeout="10000" keepAliveTimeout="900000"
socket.soKeepAlive="true" maxKeepAliveRequests="-1" />


Thanks, will look into your suggestions next time I need to debug TC, right now they are running at high throttle ;)

BTW I'm using Apache Tomcat/7.0.27

tcpdump snippet between nginx(10.45.69.14) and TC(10.45.69.25), where TC RESETs cnx instead of replying:

01:15:49.744283 IP 10.45.69.14.58702 > 10.45.69.25.8081: Flags [P.], seq 31688:39753, ack 191, win 219, options [nop,nop,TS val 38708511 ecr 32578863], length 8065
/PUT /<redacted URL> HTTP/1.1^M
Host: mosgenericbackend^M
Content-Length: 7811^M
Content-Type: application/x-www-form-urlencoded^M
User-Agent: Java/1.8.0_66^M
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2^M
^M
<redacted args>
01:15:49.744311 IP 10.45.69.25.8081 > 10.45.69.14.58702: Flags [R], seq 1376851868, win 0, length 0
01:15:49.744467 IP 10.45.69.14.58702 > 10.45.69.25.8081: Flags [.], ack 192, win 219, options [nop,nop,TS val 38708512 ecr 32578874], length 0
01:15:49.744480 IP 10.45.69.25.8081 > 10.45.69.14.58702: Flags [R], seq 1376851869, win 0, length 0
Subject Author Posted

upstream prematurely closes cnx => 502 Bad Gateway to client

stefws March 03, 2016 05:10AM

Re: upstream prematurely closes cnx => 502 Bad Gateway to client

stefws March 03, 2016 05:57AM

Re: upstream prematurely closes cnx => 502 Bad Gateway to client

B.R. March 03, 2016 06:54AM

Re: upstream prematurely closes cnx => 502 Bad Gateway to client

stefws March 04, 2016 02:12AM

Re: upstream prematurely closes cnx => 502 Bad Gateway to client

stefws March 04, 2016 05:00AM

Re: upstream prematurely closes cnx => 502 Bad Gateway to client

stefws March 04, 2016 05:00AM

Re: upstream prematurely closes cnx => 502 Bad Gateway to client

Aleksandar Lazic March 04, 2016 05:50AM

Re: upstream prematurely closes cnx => 502 Bad Gateway to client

stefws March 04, 2016 08:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 291
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready