Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGINX Configuration to Boost Performance #1964

Open
fero-majeeth opened this issue Oct 28, 2024 · 1 comment
Open

NGINX Configuration to Boost Performance #1964

fero-majeeth opened this issue Oct 28, 2024 · 1 comment
Assignees

Comments

@fero-majeeth
Copy link

Hi Team,

I tested the scenario (proxy termination case, downstream is HTTPS and upstream is HTTP) with a 64KB file using the OpenSSL engine and observed that the throughput is very low for small files (64KB). I have attached the proxy and backend server configurations. Please review the configurations and guide me if any additional configurations are needed to boost performance.

For single process NGINX, I am getting 0.11 GBPS with 256 TPS.

OpenSSL version: 1.1.1q
NGINX version: release-1.22.0

Proxy configuration:

events {
use epoll;
worker_connections 65536;
multi_accept on;
accept_mutex off;
}

http {
keepalive_timeout 300s;
connection_pool_size 1024;
keepalive_requests 1000000;
access_log off;

    upstream backend {
        server 17.0.0.5:8000;

        keepalive 32;
        keepalive_requests 1000;
        keepalive_time 1h;
        keepalive_timeout 60s;
    }


    server {
            listen 443 ssl default_server;
            ssl_certificate /etc/nginx/certs/server.crt.pem;
            ssl_certificate_key /etc/nginx/certs/server.key.pem;
            ssl_client_certificate /etc/nginx/certs/RootCA.crt.pem;
            ssl_asynch on;
            ssl_max_pipelines 8;
            root /var/www/html;
            gzip on;
            gzip_types text/plain text/css;
            gzip_min_length 20;
            gzip_comp_level 5;
            gzip_vary on;
            gunzip on;

            ssl_session_tickets on;
            ssl_session_cache shared:SSL:10m;

            index index.html index.htm index.nginx-debian.html;
            server_name _;
            location / {
               proxy_pass http://backend;
               proxy_max_temp_file_size 0;
               proxy_http_version 1.1;
               proxy_set_header Connection "";
             }
    }

}

Backend Server:

events {
use epoll;
worker_connections 65536;
multi_accept on;
accept_mutex off;
}

http {
keepalive_timeout 300s;
connection_pool_size 1024;
keepalive_requests 1000000;
access_log off;
server {
listen 8000 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
}
}

@drawing
Copy link
Collaborator

drawing commented Nov 14, 2024

@fero-majeeth During the stress test, check the CPU consumption of the tengine process. It is possible that gzip compression consumes more CPU and the CPU is fully utilized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants