2

I have a Joomla site causing very high (php) load on the server. I have already ran the MySQL slow log feature and it doesn't appear to be MySQL.

What are some ways to analyze a Joomla site to determine what causes the high php load?

Example of highest processes for the day:

testing1    testing1.com    27.32   0.53    0.3
Top Process %CPU 179    /usr/bin/php /home/testing1/public_html/index.php
Top Process %CPU 138    /usr/bin/php /home/testing1/public_html/index.php
Top Process %CPU 137    /usr/bin/php /home/testing1/public_html/index.php

Using latest 1.5 Joomla on a CentOS server running Apache/MySQL. I have full/root access to this server, so whatever tools are needed I can install.

I know the general idea is that a number of 3rd-party components are probably causing this, but how can I determine which ones (without removing/disabling them)?

1 Answer 1

3

It's still going to be hard diagnosing the problem without disabling suspected components (diagnosing performance problems is like diagnosing any other sort of problem; it's a process of elimination, which requires isolating/controlling different variables to test different hypotheses), but useful tools to have are:

  • Monitoring / visualization tools: e.g. dstat + gnuplot, log analyzers, etc.
  • Stress/load testing tools: e.g. httperf, Autobench, ApacheBench (ab), OpenWebLoad, etc.
  • Code profiling tools: e.g. Dbg, Xdebug, CodeAnalyst, Dtrace, pmp, or whatever profiling tools come with your app framework's debugging facilities.
  • Other: Aspera is basically a MySQL performance diagnostic toolkit used by Percona, but a lot of these tools have more general purpose usefulness, such as tools for profiling IO, for stack traces, for triggering a script or event when certain conditions are met, for drilling down collected data, etc. It provides a lot of the "glue" for an efficient diagnostic workflow.
2
  • The reason I mentioned I can't remove components is because it's a live environment. I could create a test site, but with no traffic I wouldn't be able to see any difference in CPU usage. I could replicate "dumb" traffic maybe, but I don't think that's going to hit every single component feature that is helping cause the high load.
    – Zeno
    Jan 28, 2012 at 0:04
  • 1
    @Zeno: you could use a combination of the two. Analyze the logs on the production server to determine which requests are causing the high loads, and then using load testing utilities to replicate those traffic patterns in order to find the performance bottleneck on the test site. You can probably use something like Selenium to replay the exact activities that are causing a high load period on the production server. Jan 28, 2012 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.