From df1bdb7ab6d69ac4b7ff3447ee44ffe655ca8ef8 Mon Sep 17 00:00:00 2001 From: Aitte Date: Sun, 24 Feb 2013 15:47:51 -0500 Subject: [PATCH] nginx.conf: Make use of the "auto" directive to let nginx spawn as many workers as there are CPU cores --- nginx/nginx.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index ffacf37..b4f2e6d 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,14 +1,14 @@ # Set another default user than root for security reasons user www www; -# As a thumb rule: One per CPU. If you are serving a large amount -# of static files, which requires blocking disk reads, you may want -# to increase this from the number of cpu_cores available on your -# system. +# How many worker threads to run; "auto" sets it to the number +# of CPU cores available in the system, and offers the best +# performance. Don't set it higher than the number of CPU cores +# if changing this parameter. # # The maximum number of connections for Nginx is calculated by: # max_clients = worker_processes * worker_connections -worker_processes 1; +worker_processes auto; # Maximum file descriptors that can be opened per process # This should be > worker_connections