On Sep 16, 2012, at 3:55 , justin wrote:
> I am trying to get fancy and have `nginx.conf` auto-detect the number of
> CPU's on the server and then set `worker_processes` to that number. Here is
> what I have:
>
> worker_processes $(cat /proc/cpuinfo | grep "processor" | sort -u | wc
> -l);
>
> Unfortunately, that is throwing an error on nginx start. Is it even possible
> to run shell commands from inside nginx configuration files?
You can configure it via command line:
nginx -g "worker_processes `cat /proc/cpuinfo | grep "processor" | sort -u | wc -l`;"
--
Igor Sysoev
http://nginx.com/support.html
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx