Welcome! Log In Create A New Profile

Advanced

Nginx only uses 1 cpu of 4

Posted by Josua 
Nginx only uses 1 cpu of 4
August 30, 2012 01:06PM
Hey All

I have just recently switched to Nginx but I am experiencing a weird behavior where the server (4 cpus and 16GB ram) uses 1 cpu to 100% but lets the 3 rest be used only to 20%. Any help would be greatly appreciated.

My settings are:

nginx.conf

user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
#worker_connections 768;
worker_connections 19000;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 3;
types_hash_max_size 2048;
# server_tokens off;

www.conf

pm = dynamic
pm.max_children = 10
pm.start_servers = 16
pm.min_spare_servers = 8
pm.max_spare_servers = 24
pm.max_requests = 500
Re: Nginx only uses 1 cpu of 4
August 31, 2012 02:33AM
Try this one: (nginx.conf)

worker_processes 4; # depending on number of processors
worker_cpu_affinity 0001 0010 0100 1000; # bind the worker process to a CPU
worker_priority -1;
worker_rlimit_nofile 8162;
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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