Getting upstream error [connect() failed (110: Connection timed out) while connecting to upstream]

Vivek Solanki vivek.solanki at einfochips.com
Mon Jun 10 14:15:03 UTC 2019


Hi Team,

I have setup a nginx server through which requests are forwarding to AWS ELB by nginx proxy_pass (configured on /etc/nginx/default.d/my.conf) on. Behind AWS ELB tomcat application running on instances. After performing load test (15k-20k throughput) using Jmeter it is working fine, but after raising the throughput value it gives below upstream errors:

2019/06/06 15:54:32 [error] 31483#0: *924684 connect() failed (110: Connection timed out) while connecting to upstream, client: 172.29.XX.XX, server: _, request: "GET /example1/model/v2/4SBWFWMMFWKWDWFS178S94DFDE/imageurl HTTP/1.1", upstream: "https://XX.XX.XX.XX:443/example1/model/v2/4SBWFWMMFWKWDWFS178S94DFDE/imageurl", host: "myapp.example.com"

2019/06/10 13:55:20 [error] 28423#0: *492252 no live upstreams while connecting to upstream, client: 172.29.XX.XX, server: _, request: "GET /example1/model/v2/4SBWFWMMFWKWDWFS178S94DFDE/imageurl HTTP/1.1", upstream: "https://XX.XX.XX.XX:443/example1/model/v2/4SBWFWMMFWKWDWFS178S94DFDE/active", host: " myapp.example.com "

I have already tried to made many changes in nginx.conf file, below is showing complete conf file details. On restart or reload nginx service, issue is resolved. But this is not the permanent solution.

Nginx.conf :

#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes 8;
error_log /var/log/nginx/error.log debug;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 50000;
    use epoll;
    }

worker_rlimit_nofile 30000;

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   30;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Default is HTTP/1, keepalive is only enabled in HTTP/1.1
    proxy_http_version 1.1;
    # Remove the Connection header if the client sends it,
    # it could be "close" to close a keepalive connection
    proxy_set_header Connection "";


    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        error_page 404 /404.html;
            location = /40x.html {
                }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }


Thanks in advance

Regards,
Vivek Solanki









************************************************************************************************************************************************************* eInfochips Business Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated. Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. *************************************************************************************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20190610/db2e9d0b/attachment-0001.html>


More information about the nginx mailing list