Nginx 14.1 very slow as a reverse proxy

Maxim Dounin mdounin at
Tue Nov 20 13:48:51 UTC 2018


On Mon, Nov 19, 2018 at 07:37:34PM -0600, Ricky Gutierrez wrote:

> Hi list , I need a little help, I have a reverse proxy in front of an
> application, the nginx server has it with 4gb ram, disk sas at
> 15K and 2 core in centos 7, I've noticed that the proxy acts very
> slow, checking the log I see a lot
> 2018/11/19 14:10:04 [error] 16379#16379: *51 upstream timed out (110:
> Connection timed out) while reading response header from upstream,
> client:, server:, request: "POST
> /Usuario/Login HTTP/1.1", upstream:
> "http://192.168.X.11:80/Usuario/Login", host: "",
> referrer: ""
> if I remove the proxy and leave only the application is fast and
> without delay, I put the proxy and I have a lot of delay.
> I have around 40 concurrent connections, my internal network between
> the proxy and the IIS server is 1gb network, very fast ,

As per the error message, your backend fails to accept new 
connections in a reasonable time.  You may want to look at the 
backend to find out why it cannot accept new connections.

One of the possible reasons might be that keepalive connections 
cache you've configured is too large for your backend:

> upstream backend {
>     server 192.168.X.11:80; ## servidor web en windows
>     keepalive 15;

With "keepalive 15" nginx will keep open up to 15 connections in 
each worker proccess - that is, up to (15 * worker_processes) in 
total, and this may be too many for your backend.

Try switching off keepalive and/or using smaller cache size to see 
if it helps.

Maxim Dounin

More information about the nginx mailing list