hi,<br>thanks for your reply, I used your method and this problem didn&#39;t re-appear.<br>Another question.<br>Does proxy_cache support LRU? I read the code and find the die out of the cache item is freed by the expire time. That is, when the cache add does not succeed, it will check the expire queue and free the expired item? Am I right?<br>
<br><div class="gmail_quote">2009/5/26 Igor Sysoev <span dir="ltr">&lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Tue, May 26, 2009 at 10:08:57AM +0800, Qiu Linfeng wrote:<br>
<br>
&gt; hi,all<br>
&gt; Recently, I used nginx and found a problem. The problem is at the memory<br>
&gt; pool while I turn on the proxy_cache.<br>
&gt; Here is how I found it.<br>
&gt; I use a tool to test nginx (with proxy_cache on) and found that  CPU idle is<br>
&gt; zero while the IO  didn&#39;t get to 100%.<br>
&gt; So, I think there must have performance problem  in nginx with proxy_cache<br>
&gt; on. I used VTune to find the problem. The VTune Report shows 98% of CPU run<br>
&gt; at the fuction ngx_palloc() in  ngx_palloc.c.<br>
&gt; I read the code and I think while nginx alloc memory from a pool,  there is<br>
&gt; a cycle to get the free memory of the pool, the cycle do a lot of times. At<br>
&gt; last, I get rid of the do...while, just let each memory alloc  from the<br>
&gt; function ngx_palloc_block(). Obviously, I get rid of the &quot;for&quot; cycle in<br>
&gt; ngx_palloc_block() too. And the performance is improved a lot, while the CPU<br>
&gt; idle is not zero and the IO utils get to 100%.<br>
&gt; Can this problem be resolved in a good way?<br>
&gt; thanks for all<br>
<br>
</div></div>Try to change NGX_ALIGNMENT to 16.<br>
<font color="#888888"><br>
<br>
--<br>
Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Linfeng Qiu<br>Department of Computer Science &amp; Technology, Nanjing University<br>