views:

184

answers:

2

Updated:

================================================================ I finally found the reason with oprofile. It was because the routing cache of Symfony. We have lots of pages with different urls and symfony caches them in one file (serialized data). So the cache file grows large and it needs more CPU to serialize and unserialize data.

Everything went well after I disabled the routing cache

================================================================

We have three web servers with LVS (Apache 2.11 + PHP 5.26), and we use Symfony 1.0 for our products development.

But recently we have updated our products with Symfony 1.2.7 and we got a critical performance issue.

We use Ganglia to monitor our servers. Before the udpates, the average load of web servers is under 1; After the udpates, the load increases dramatically with load 80 at top(I can see CPU usage increases much from Ganglia).

I can't find the reasons. Is it because the Symfony framework?(But according to Ganglia, the load shouldn't increase so rapidly).

By the way, in our new products lots of AJAX are used, which means there are at least 5-7 PHP requests to open one page. Is this the reason?

Any one can help me to find all the possible reasons? Or what else information should I offer to diagnose?

Thanks in advance and looking forward to your reply~

+1  A: 

You should use a profiler to find the hot spots in your code. It's hands down the best way to pinpoint the problems -- anything else, and you're just guessing.

Rytmis
I've just installed oprofile, and what's next? Is there any specific guide?
Mickey Shine
Google suggests that oprofile is a Linux system profiler. If the problem is in the PHP application, your time is better spent using a PHP profiler, such as XDebug (which I linked to in my answer).
Rytmis
A: 

Please ensure cache directory is available for writting. Have you cleared it after you updated symfony? If not - execute

symfony cc

from shell in the project folder to do that.

FractalizeR