XF 2.1 Performance problems

jb-net

Active member
Hi,

I'm running the latest XenForo Version 2.1.7 including some addons on a Virtual Machine. The problem is recently performance was impacted negatively. Non-chached requests take up to 8 seconds, cached requests about 1-2 seconds. The database quiries don't seem the problem. It only took ~0.05s (measuring using Xenforo debug mode). It seems the php computation is using a lot of cpu power (monitoring linux "top" command).

Typical debug information:
Screen Shot 2020-02-10 12 38 11 AM.webp
(Queries:18 Time: 6.0155s Memory: 9.40MB)

Stats:
  • Xenforo 2.1.7
  • Server: Apache2 on Ubuntu 16.04.6 LTS
  • PHP Version: 7.4.2
  • Memcache: 3.1.4
  • MySQL Version: 5.7.29
  • Webserver (Cloud Ressources): 4 Core, 4 GB RAM, 100 GB SSD, 1 Gbit/s Ethernet

Any suggestions how to further get to the cause of the problem and what I can do to improve the situation? I would be glad for your help. Thanks!
 
Ensure xdebug isn't enabled, and php opcache is enabled.

In the VM check;
  • Your CPU steal stats. If it is >10% you are in for a world of hurt
  • IO Wait stats; this will make anything touching disk slow if it is high. And without php opcode caching every request touches hundred to thousands of files
 
Hi @Xon,

I followed your suggestions and disabled all addons (thanks a lot (y)). I was able to identify the problem-causing addon, which is an ad manager addon for Xenforo :(. I contacted the addon author and he assured me that this addon is working correctly for many other customers. It might have something to do with my configuration or Xenforo installation.

I did further research and discovered this thread in which you also participated in. I'm not completely sure but it sounds familiar. Enabling/disabling this ad manager addon or doing other template changes put a lot of stress on my server. I also noticed extremely slow performance of css.php loading time (up to 10 seconds) if it isn't cached already.

But I don't only see it during addon installation or theme updates, I also see it in normal operation if the ad manager is active. Could it have something to do with the way the ad manager is displaying the ads using template hooks or template modifications?

Do you have any idea or suggestion how I could further investigate my problem?
Is this a general problem of Xenforo or resulting from my upgrade path (upgrading from 1.4 -> 1.5 -> 2.0 to 2.1) or using some child styles?

You also suggested using your Redis Cache add-on could help. But I assume installing the addon wouldn't be enough, I would also use Redis, correct? And does it only change the way of batch processing (e.g. during addon or theme installation) or also under normal use?

Thanks for your help! I'm really appreciating it!
 
Make sure you've got a caching provider setup, even for a development board as it prevents from causing rather painful caching issues. Yes, my Redis Cache add-on does require Redis which runs as a separate process

I'm not sure why css generation for that one add-on is so slow, sounds like it may be doing something silly
 
Hi Xon, thanks for your reply!

I'm not sure why css generation for that one add-on is so slow, sounds like it may be doing something silly

The slow and stressfull (the apache2 process causes nearly 100% cpu for up to 20 sec) execution of css.php doesn't seem to be directly connected with this admanager addon. I just noticed it upgrading/enabling/disabling the addon that after template changes the css.php needs to be regnerated, which is resulting in my problem.

But now I fully uninstalled the admanager addon and I'm still suffering from the problem of the slow css.php. Even after disabling all addons and using the default style the css.php is causing me troubles.

Is there any way to further investigate why the execution of my css.php is so slow/stressfull (high cpu load for extended period of time)?
 
Back
Top Bottom