擅长:python、mysql、java
<p>我在Slicehost(django 1.1,python2.6)和Dreamhost(django 1.0,python2.5)上都以fastcgi的身份运行过django,我可以这样说:</p>
<p>运行<code>top</code>命令会显示进程使用大量CPU来启动~2-3秒,然后几乎立即降到0。在</p>
<p>在启动django应用程序之后运行<code>ps aux</code>命令会显示类似于您所描述的内容,<strong>但是</strong>这实际上是误导。从Ubuntu ps手册页:</p>
<blockquote>
<p>CPU usage is currently expressed as
the percentage of time spent running
during the entire lifetime of a
process. This is not ideal, and it
does not conform to the standards that
ps otherwise conforms to. CPU usage is
unlikely to add up to exactly 100%.</p>
</blockquote>
<p>基本上,<code>ps</code>显示的%CPU列实际上是进程运行期间的平均值。你看到的衰变是由于高的初始峰值,随后是不活跃的平均值。在</p>