Profiling - an attempt to identify a problem loading a site

I took over the wordpress email (although this question is more about profiling in general), which has a performance issue that seems to affect only one specific area in the CMS administration section. When you try to edit one specific type of product to which a large number of attributes are attached, the page effectively causes the browser to crash in 99% of cases. I expected this to be due to MySQL queries causing a bottleneck, however, when I profiled db, I got the following results:

Total queries: 174 - Total MySQL query time: 0.11370

This suggests that the bottleneck occurs elsewhere, but I'm not sure where it might be. If I launched YSlow on the page, there is nothing sharp to explain the problem, although about 20 scripts and stylesheets are loaded, so some optimization could be done there. I'm going to include an opcode cache library that will improve PHP performance, but is there anything else I can do to try and identify the problem here? Thanks.

+8
profiling php mysql wordpress
source share
4 answers

firebug (add-on for firefox) is the best tool I know to find such problems. You can also install another plugin called " page speed ". it will show you which part takes longer to load. another option is to debug your code with time stamping and see which one has the greatest amount of time: http://php.net/manual/en/function.microtime.php

+1
source share

Use a profiler like Xdebug ... if the problem is not in their database, I have a problem with PHP. Don’t forget which part of the code takes longer ... Xdebug will tell you the time it took to call the function as memory.

+1
source share

The last time I profiled wordpress, it took me a dozen microtime(1) -based microtime(1) to figure out a place that took half the load time in 2.5 seconds. It was loading and parsing the .mo file of localization.

A significant advantage was to install the APC cache, as it turned out that wordpress is a heavy bloated monster, it takes a lot of time to parse it.

+1
source share

I'd

  • Use Firebug or the Chrome Net panel to see if it causes a page or JavaScript / CSS / imges causing a slowdown (front -end)
  • Use curl to find out how long the page takes: time curl -b PHPSESSID=123 http://example.com/wp-admin/
  • Enable / install Xdebug and enable profiling. Use KCachegrind to find out which functions cause the biggest delays.
+1
source share

All Articles