Welcome! Log In Create A New Profile

Advanced

keepalive strange behaviour

Posted by dmc 
dmc
keepalive strange behaviour
March 14, 2016 12:04PM
Hi,

I'm trying to improve the performance of a webapp behind nginx 1.9.7. My server freezes due to the high time_wait ports.
I added the keepalive sentece to the upstream and the "proxy_http_version 1.1;" and "proxy_set_header Connection "";" to the location but I'm still having this issues.

I tried with a simple node js webserver that simulates the flow o the real app (just 302 redirects) and with this server works fine.The real webapp servers are pretty much the same and are developed in node js (not by me).

What could be happening here?

Thanks!
Re: keepalive strange behaviour
March 14, 2016 12:22PM
Some logging files, config used and a simple explanation what requests are made would help.

https://forum.nginx.org/read.php?1,252530

---
nginx for Windows http://nginx-win.ecsds.eu/
dmc
Re: keepalive strange behaviour
March 15, 2016 02:53AM
Attached a non working debug log and a working debug log.

My nginx.conf looks like:

user nginx;
worker_processes auto;

error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;

worker_rlimit_nofile 250000;


#error_log /var/log/nginx/error.log warn;

events {
worker_connections 125000;
multi_accept on;
use epoll;
}


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

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;

keepalive_timeout 65;

gzip on;

proxy_connect_timeout 3;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;

add_header X-Frame-Options SAMEORIGIN;

server_tokens off;

add_header X-Frame-Options SAMEORIGIN;

server {
listen 127.0.0.1:80;
ssl off;

location /status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
}

include /etc/nginx/conf.d/*.conf;
}


And both location used in the files looks like the config below:

location /test {
error_page 500 502 503 504 /custom_50x-es.html;
error_page 400 403 404 /custom_40x-es.html;
proxy_next_upstream http_500 http_503 http_504 timeout error;
proxy_intercept_errors on;
proxy_pass http://estest;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
Attachments:
open | download - wotking.txt (29 KB)
open | download - notworking.txt (52.7 KB)
Re: keepalive strange behaviour
March 15, 2016 03:41AM
Try with these options disabled,

# multi_accept on;
# use epoll;
# sendfile on;

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 297
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