Hi,<br><br><div class="gmail_quote">On Sun, Sep 16, 2012 at 7:55 AM, justin <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us" target="_blank">nginx-forum@nginx.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am trying to get fancy and have `nginx.conf` auto-detect the number of<br>
CPU's on the server and then set `worker_processes` to that number. Here is<br>
what I have:<br>
<br>
worker_processes $(cat /proc/cpuinfo | grep "processor" | sort -u | wc<br>
-l);<br>
<br>
Unfortunately, that is throwing an error on nginx start. Is it even possible<br>
to run shell commands from inside nginx configuration files?<br></blockquote><div><br></div><div>It's not supported in current nginx.</div><div><br></div><div>But you may try out tengine, which is a nginx distribution and has the exact feature you want: <a href="http://tengine.taobao.org/document/core.html">http://tengine.taobao.org/document/core.html</a></div>
<div>More features can be found at: <a href="http://tengine.taobao.org/">http://tengine.taobao.org/</a></div><div><br></div></div><div>Regards,</div><div><br></div>-- <br>Joshua Zhu<br>Senior Software Engineer<br>Server Platforms Team at Taobao<br>