Measure the load added by a plugin

Hello everyone!

I have a Elgg site (social network) with 300 users approximately, and my site has a several third party plugins active (around 25). In a common day, users that are active at the same time are 20, but in special events this value increase to 200 users active at the same time.

The first time, the site suffered a big stress and users had problems to use the social network. I followed several advices about cache, memcached, mysql, apache, etc. to obtain the most optimal configurations and the social network improved its performance. As I expect the number of users increases in the future, another issues that I examinated was design and reproduce stress tests with JMeter and Selenium in a replic of my site.

The results of stress tests shown me that several plugins produce a big load in the site. With the intention of improve the efficiency of the plugins that I use or will use, ¿How I can measure its impact: number of sql queries, slow php code, innecessary repetition of processes, etc.?

  • If you are using a shared hosting servers to host your Elgg website, and your website is put on a server with hundreds, and sometimes thousands of other websites, you will have issues with performance because some websites might not use properly coded theme. Regardless of the number of plugins,cache, memcached, mysql, and Apache configurations --- if a website on the same server with your website experiences a large surge in traffic due to  a post going viral or the post is viewed a lot by the public, then your site will load slowly as a result.

    I don't remember at the moment the right plugin to use for your plugins stress test.

  • My site is hosted in a powerful server of my property, and no other host is located in it. So there is no external influence.

    I have detected (observed) that some plugins produce a lot of CPU consumption, and that the number of queries to the database is very high for the number of users. So I want to measure the impact of the plugins individually.

  • Elgg 2.1 added a simple profiler that's only documented in settings.php, and reports data in the JS console. If you do this on an empty page (e.g. login) you can at least measure a baseline for core+plugin boot plus page generation. Ultimately Elgg is a vanilla PHP/MySQL app so the same testing/metrics/recommendations apply. Upgrade PHP first! You might look into Blackfire, but AFAIK no one on the core team has tried that yet.

  • Thank you very much for your help (@steve_clay).

    I followed your advice. I tested the profiler and obtained a good experience. In the next time...I maybe will test with Blackfire. I will report about my advances.

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.