Nginx worker processes

1.7k Views Asked by At

I am using docker nginx as a reverse proxy for my backend rails api application scaled in docker containers also.

During the perfomance tests I get such errors:

4048 worker_connections are not enough

I found out that I have a default value of worker_processes = 1. After that I changed this value up to 8 (on 8 vCPU ubuntu server), but still get this error.

Looking on htop it seems that other workers doesn't work under highload...

enter image description here

Here is my nginx.conf

user  nginx;
worker_processes  8;

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


events {
    worker_connections  4048;
}


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;

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

There are 0 best solutions below