hi,all<br>Recently, I used nginx and found a problem. The problem is at the memory pool while I turn on the proxy_cache.<br>Here is how I found it.<br>I use a tool to test nginx (with proxy_cache on) and found that CPU idle is zero while the IO didn't get to 100%.<br>
So, I think there must have performance problem in nginx with proxy_cache on. I used VTune to find the problem. The VTune Report shows 98% of CPU run at the fuction ngx_palloc() in ngx_palloc.c.<br>I read the code and I think while nginx alloc memory from a pool, there is a cycle to get the free memory of the pool, the cycle do a lot of times. At last, I get rid of the do...while, just let each memory alloc from the function ngx_palloc_block(). Obviously, I get rid of the "for" cycle in ngx_palloc_block() too. And the performance is improved a lot, while the CPU idle is not zero and the IO utils get to 100%.<br>
Can this problem be resolved in a good way?<br>thanks for all<br clear="all"><br>