Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling advice - trying to pinpoint site loading issue

I've taken over a wordpress e-comm (although this question is more about profiling generally) site which has a performance issue which seemingly only affects one specific area in the admin section of the CMS. When trying to edit one particular type of product, which has a large number of attributes attached to it, the page effectively causes the browser to crash 99% of the time. I expected this to be down to MySQL queries causing the bottleneck, however when I profiled the db, I got the following results:

Total Queries: 174 - Total Time Of MySQL Queries: 0.11370

This suggests the bottleneck is happening elsewhere, but I'm not sure where it could be. If I run YSlow on the page, there is nothing drastic there which would explain the issue, although there are around 20 scripts and stylesheets loaded, so some optimisation could be done there. I'm going to enable an opcode cache library which will improve PHP performance, but is there anything else I can do to try to identify the issue here? Thanks.

like image 528
bsod99 Avatar asked Jan 29 '12 19:01

bsod99


3 Answers

Use a Profiler like Xdebug...if the problem is not their in database my be PHP has the problem..find out which part of code is taking longer...Xdebug will tell you time taken per function call as well as memory usase.

like image 60
Mukesh Avatar answered Nov 15 '22 03:11

Mukesh


Last time I profiled wordpress, it took me a dozen microtime(1)-based calculations to spot the place that took half of 2.5 seconds loading time. It was loading and parsing of .mo localization file.

Also considerable gain was from installing APC cache, as it turned out that wordpress is a heavy bloated monster consumes a lot of time to parse it's codes.

like image 1
Your Common Sense Avatar answered Nov 15 '22 03:11

Your Common Sense


I would

  • Use Firebug's or Chrome's Net panel to see if it's the page or the JavaScript/CSS/imges that are causing the slowdown (front-end)
  • Use curl to see how long the page takes: time curl -b PHPSESSID=123 http://example.com/wp-admin/
  • Enable/install Xdebug and turn profiling on. Use KCachegrind to see which functions are causing the biggest delays.
like image 1
dave1010 Avatar answered Nov 15 '22 04:11

dave1010