My understand on disabled Nginx's proxy buffering is that the app server will wait the client to respond instead of Nginx, so I should see many open connections, but it's not the case in my testing.
Setup:
client (10.2.0.7) <===> Nginx (10.2.0.5) <===> PythonApp (10.2.0.4, port 8000)
500 slow connections initiated by the client
slowhttptest -c 500 -H -g -o my_header_stats -i 10 -r 50 -t GET -u http://pythonapp.com -x 24 -p 3
Nginx Conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events
{
worker_connections 768;
# multi_accept on;
}
http
{
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# gzip on;
upstream pythonapp
{
server 10.2.0.4:8000;
}
proxy_buffering off;
server
{
listen 80;
proxy_buffering off;
server_name pythonapp.com;
location /
{
proxy_buffering off;
proxy_pass http://pythonapp;
}
}
# include /etc/nginx/conf.d/*.conf;
# include /etc/nginx/sites-enabled/*;
}
Can only see 1 open connection from Nginx
If I initiate slow connections from client to PythonApp server directly, I can see many open connections Setup:
client (10.2.0.7) <===> PythonApp (10.2.0.4, port 8000)
500 slow connections initiated by the client
slowhttptest -c 500 -H -g -o my_header_stats -i 10 -r 50 -t GET -u http://10.2.0.4:8000 -x 24 -p 3
My questions are
- Why my app server doesn't have many open connections after Nginx reverse-proxies it?
- If my setting is incorrect, can you provide explicit code & config example to set up the corresponding environment, so as to show the performance or throughput difference between enabled remote buffering and disabled remote buffering?