<div dir="ltr"><div style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12pt;line-height:inherit;font-family:Calibri,Helvetica,sans-serif;vertical-align:baseline;color:rgb(0,0,0)">Hi to all,</div><div style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12pt;line-height:inherit;font-family:Calibri,Helvetica,sans-serif;vertical-align:baseline;color:rgb(0,0,0)"><br></div><div style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12pt;line-height:inherit;font-family:Calibri,Helvetica,sans-serif;vertical-align:baseline;color:rgb(0,0,0)">I have a NGINX and configure it as load balancer (hash remote_IP) in front of java application. When number of requests are normal all things good and working fine but when requests go high<span style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;color:inherit"> </span><span style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;color:inherit">NGINX<span style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;color:inherit"> </span></span>has a delay to response to each request. at this moment if I stop<span style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;color:inherit"> </span><span style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;color:inherit">NGINX</span><span style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;color:inherit"> </span>and requests straight to application (java app and use tomcat as webserver) it works without delay but when use<span style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;color:inherit"> </span><span style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;color:inherit">NGINX</span><span style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;color:inherit"> </span>it works with delay.</div><div style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12pt;line-height:inherit;font-family:Calibri,Helvetica,sans-serif;vertical-align:baseline;color:rgb(0,0,0)"><br></div><div style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12pt;line-height:inherit;font-family:Calibri,Helvetica,sans-serif;vertical-align:baseline;color:rgb(0,0,0)">This is nginx.conf file:</div><div style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12pt;line-height:inherit;font-family:Calibri,Helvetica,sans-serif;vertical-align:baseline;color:rgb(0,0,0)"><br><div class="snippet"><div class="'snippet + user  root; + ' hljs cs" style="display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248);font-family:monospace">user  root;<br>worker_processes  auto;<br><span class="hljs-meta" style="color:rgb(31,113,153)">#error_log  logs/<span class="hljs-meta-keyword" style="font-weight:bold">error</span>.log;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">#error_log  logs/<span class="hljs-meta-keyword" style="font-weight:bold">error</span>.log  notice;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">#error_log  logs/<span class="hljs-meta-keyword" style="font-weight:bold">error</span>.log  info;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">#pid        logs/nginx.pid;</span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">worker_rlimit_nofile 100000;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">events {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    worker_connections  40000;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    #   use epoll;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    #    multi_accept on;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">}</span><br><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">http {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">error_log  /appserver/nginx/logs/<span class="hljs-meta-keyword" style="font-weight:bold">error</span>.log crit;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">error_log  /appserver/nginx/logs/<span class="hljs-meta-keyword" style="font-weight:bold">error</span>.log emerg;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">error_log  /appserver/nginx/logs/<span class="hljs-meta-keyword" style="font-weight:bold">error</span>.log <span class="hljs-meta-keyword" style="font-weight:bold">error</span>;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">error_log  /appserver/nginx/logs/<span class="hljs-meta-keyword" style="font-weight:bold">error</span>.log alert;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">error_log  /appserver/nginx/logs/debug.log debug;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">error_log  /appserver/nginx/logs/warn.log warn;</span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">include     mime.types;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">default_type application/octet-stream;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">fastcgi_read_timeout 100000;</span><br><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">        log_format netdata '$remote_addr - $remote_user [$time_local] '</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">                      '"$request" $status $body_bytes_sent '</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">                      '$request_length $request_time $upstream_response_time $bytes_sent '</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">                      '"$http_referer" "$http_user_agent" $upstream_addr '</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">'request_time=$request_time '</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">               'upstream_response_time=$upstream_response_time '</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">               'upstream_connect_time=$upstream_connect_time '</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">               'upstream_header_time=$upstream_header_time '</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">                '$msec';</span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">        access_log /appserver/nginx/logs/access.log netdata;</span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">    client_body_buffer_size 256k;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    client_header_buffer_size 256k;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    subrequest_output_buffer_size 128k;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    proxy_buffer_size 128k;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    proxy_buffers 4 256k;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    proxy_busy_buffers_size 256k; </span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    fastcgi_buffers 16 16k;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    fastcgi_buffer_size 32k;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    client_max_body_size 100M;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    sendfile        on;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    tcp_nopush      on;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    tcp_nodelay     on;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    access_log      on;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    keepalive_timeout 600;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    client_body_timeout 600;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    client_header_timeout 600;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    send_timeout 10;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    reset_timedout_connection on;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    gzip  on;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    gzip_min_length 10240;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    gzip_comp_level 1;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    gzip_vary on;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    gzip_disable msie6;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    gzip_proxied expired no-cache no-store private auth;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    gzip_types</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">text/css</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        text/javascript</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        text/xml</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        text/plain</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        text/x-component</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        application/javascript</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        application/x-javascript</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        application/json</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        application/xml</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        application/rss+xml</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        application/atom+xml</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        font/truetype</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        font/opentype</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        application/vnd.ms-fontobject</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        image/svg+xml;</span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">    upstream nginxBRANCH21 {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        server x.x.x.21:448  max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    }</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    upstream nginxBRANCH {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        #server x.x.x.x:443  max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        #server x.x.x.x:448  max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        server x.x.x.x:448  max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        server x.x.x.x:443  max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        server x.x.x.x:443  max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        server x.x.x.x:443  max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        server x.x.x.x:443  max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        server x.x.x.x:443   max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        hash $remote_addr;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">} </span><br><span class="hljs-meta" style="color:rgb(31,113,153)">     upstream server150 {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">           server x.x.x.x:443  max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">     }</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">     upstream nginx_Z {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">           server x.x.x.x:448  max_fails=1      fail_timeout=15s;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">     }</span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">     server {  </span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        listen 80 default_server;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        server_name _;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        return 301 https://$host$request_uri;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">     }</span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">     </span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        server {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        listen           443  ssl;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        ssl_protocols        TLSv1 TLSv1.1 TLSv1.2;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">      # ssl                 on;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        ssl_certificate      /etc/ssl/certs/myssl.crt;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        ssl_certificate_key  /etc/ssl/private/</span><span class="hljs-meta" style="color:rgb(31,113,153)">myssl.key</span><span class="hljs-meta" style="color:rgb(31,113,153)">;</span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">        location / {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            #<span class="hljs-meta-keyword" style="font-weight:bold">if</span> ( $remote_addr ~ "(x.x.x.x)|(x.x.x.x)|(x.x.x.x)|(x.x.x.x)|(x.x.x.x)|(x.x.x.x)|(x.x.x.x)|(x.x.x.x)|(x.x.x.x)" ){</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            #   proxy_pass   <a href="https://server150">https://server150</a>;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            #}</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_pass          <a href="https://nginxBRANCH21">https://nginxBRANCH21</a>;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_set_header    X-Real-IP $remote_addr;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_set_header    Host $http_host;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_set_header    X-NginX-Proxy true;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_set_header    X_FORWARDED_PROTO https;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_read_timeout     100000;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_connect_timeout  100000;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        }</span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">        location /FCBZ {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_pass          <a href="https://nginx_Z">https://nginx_Z</a>;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_set_header    X-Real-IP $remote_addr;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_set_header    Host $http_host;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_set_header    X-NginX-Proxy true;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_set_header    X_FORWARDED_PROTO https;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_read_timeout     100000;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">            proxy_connect_timeout  100000;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        }</span><br><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">        }</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">    </span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">    </span><br><span class="hljs-meta" style="color:rgb(31,113,153)">server {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">   listen 9666;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">     location /basic_status {</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">        stub_status;</span><br><span class="hljs-meta" style="color:rgb(31,113,153)">}</span><br><br><span class="hljs-meta" style="color:rgb(31,113,153)">    } </span><br><span class="hljs-meta" style="color:rgb(31,113,153)">}</span></div></div><br><br></div><div style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12pt;line-height:inherit;font-family:Calibri,Helvetica,sans-serif;vertical-align:baseline;color:rgb(0,0,0)">Can anyone help me?<br></div><div style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12pt;line-height:inherit;font-family:Calibri,Helvetica,sans-serif;vertical-align:baseline;color:rgb(0,0,0)">Thank you</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><table cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;border-spacing:0px;background:0px 50%;margin:0px;border:0px;table-layout:auto;padding:0px;outline:0px;font-family:ProximaNova,sans-serif"><tbody style="margin:0px;padding:0px;outline:0px;border:0px"><tr style="margin:0px;padding:0px;outline:0px;border:0px"><td valign="middle" style="font-family:ProximaNova,sans-serif;padding:0px 10px 0px 0px;outline:0px;border:0px;font-size:0.875rem;line-height:normal;vertical-align:middle"><a href="https://www.yourcompany.com/" style="background-color:transparent;color:rgb(24,199,201);line-height:inherit;margin:0px;padding:0px;outline:0px;border:0px" target="_blank"></a></td><td style="font-family:ProximaNova,sans-serif;padding:0px 30px 0px 0px;outline:0px;border:0px;font-size:0.875rem;line-height:normal;vertical-align:middle"><br><table cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;border-spacing:0px;background:0px 50%;margin:0px;border:0px;table-layout:auto;padding:0px;outline:0px"><tbody style="margin:0px;padding:0px;outline:0px;border:0px"><tr style="margin:0px;padding:0px;outline:0px;border:0px;font-size:11.375px"><td style="font-family:ProximaNova,sans-serif;padding:0px;outline:0px;border:0px;font-size:0.875rem;line-height:normal"><span style="margin:0px;padding:0px;outline:0px;border:0px;font-family:Georgia;font-weight:bold;font-stretch:normal;line-height:normal;color:rgb(0,0,0)">Hamid Gholami</span> <span style="margin:0px;padding:0px;outline:0px;border:0px;font-family:Arial;font-size:10px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)">DevOps Engineer</span><span style="margin:0px;padding:0px;outline:0px;border:0px;font-family:Arial;font-size:10px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"></span></td></tr><tr style="margin:0px;padding:0px;outline:0px;border:0px;background-image:initial;background-position:0px 50%;background-repeat:initial;font-size:11.375px"><td style="padding:8px 0px 0px;outline:0px;border:0px;font-size:10px;line-height:normal"><br><table cellpadding="0" cellspacing="0" style="border-spacing:0px;border-collapse:collapse;color:rgb(68,68,68);width:400px;font-size:9pt;font-family:Arial,sans-serif;line-height:normal"><tbody><tr><td colspan="2" width="400" style="font-family:Arial,sans-serif;padding:0px;color:rgb(44,44,44);width:400px"><span><font size="1"><b> t: </b>+982191002809</font></span></td></tr><tr><td colspan="2" width="400" style="font-family:Arial,sans-serif;padding:0px;color:rgb(44,44,44);width:400px"><span><font size="1"> <b>m:</b> +989126105157</font></span></td></tr></tbody></table><b><a href="https://www.linkedin.com/in/hamid-gholami/" target="_blank">Linkedin</a> , <a href="https://twitter.com/HamidGholami6" target="_blank">Twitter</a> , <a href="https://t.me/hamid045" target="_blank">Telegram</a></b></td></tr><tr style="margin:0px;padding:0px;outline:0px;border:0px;font-size:11.375px"><td style="font-family:ProximaNova,sans-serif;padding:3px 0px 0px;outline:0px;border:0px;font-size:10px;line-height:normal"><a href="https://www.honeybook.com/email-signature" style="background-color:transparent;color:rgb(0,0,0);line-height:normal;margin:0px;padding:0px;outline:0px;border:0px;font-family:Arial;font-stretch:normal" target="_blank"></a></td></tr></tbody></table></td></tr></tbody></table></div></div></div>