XF 2.1 High server load during theme update

Recep Baltaş

Well-known member
When upgrading 3rd party themes, server load goes nuts! Confirmed with two different themes from different devs.

Load Averages: 142.04 122.49 79.36

And it takes more than 10 minutes to upgrade a theme!


194376

There was no such issue with 2.0..
 
Last edited:
On my own site and another large site, I've observed that XF will use massively more CPU during the add-on installs & adding new templates/styles operations above what is expected (that is, every other session not just the admin session doing the changes). With the is_processing flag, these shouldn't be actually running and points to some cache being repeatedly invalidated.

What I did notice was the jobs TemplateRebuild/TemplatePartialCompile (and some others) use the \XF\Service\Template\Compile which updates all styles last modified date, which then invalidates all cached css. This happens per web-request rather than at the end of the template rebuild/compiling jobs. The PhraseRebuild job would be similar.

Add-on install is also impacted, as each template import which rattles around before hitting a template recompile, and then again with template modifications. xf_css_cache is also evacuated immediately, but before the style last modified date is updated, resulting in this table receiving a lot more write traffic than expected.

With batch installing, and complex add-ons, this can result in a large number of requests during the installing phase.

Has there been a fix for this? I just upgraded from XF1 to XF2.1 and my server basically halts for ten minutes every time I try to do anything style-related. I can't even create a new style unless I shut down the board... SQL times out and the new style is badly corrupted.

Looking at how performance is being impacted, it's pretty obvious that it's a cache invalidation problem.
 
Last edited:
My workaround is built into my Redis Cache add-on which adjusts the caching logic, it helps migrate this

I just installed redis and your Redis Cache and Redis View Counters addons, and it doesn't seem to help at all. I still need to disable the board to do anything that touches templates.

Here's my admincp Redis info which seems to show Redis is installed and doing something.

Version 4.0.11
phpredis version N/A
Using Lua Yes
Serializer igbinary
Free memory Unlimited
Used memory 3 MB
Peak memory 15.3 MB
To Redis (kbps) 14
From Redis (kbps) 1,114
Operations per second 26
DB 0 Keys 2,164
DB 0 Average TTL 2,634,773
Connected clients 2
 
I managed to "fix" this by upgrading to php7.3/opcache and Redis cache (not Xon's)
Server load still rises when touching templates or ads, but much less than before.
 
It seems that any time I (or add-ons that are installing) touch the templates, the entire forum can barely load for a while. Is this the same issue reported in this thread?
 
It seems that any time I (or add-ons that are installing) touch the templates, the entire forum can barely load for a while. Is this the same issue reported in this thread?
Exactly the same issue. Also, try to merge users, sometimes it's stuck at half with users' post scattered betweeen accounts. Total chaos... Something is messed up after 2.1...
 
Yo,
we have the exact same issue. For me, it even happens when changing a phrase sometimes.
@Recep Baltaş did you find a fix or a solution in the meantime? You said this problem did not exist on older versions, do you remember which versions were not affected by these slowdowns by any chance?
 
I had had the same problems last year with 1 processor core and 1 GB memory.
I switched hosts and now have for less money 8 processor cores an 6 GB memory and no more the problems I had while workin on themes or upgrading the forum software.
Most for all, the speed of my forum is now maximum and also mobile speed is almost maximum.
 
Yo,
we have the exact same issue. For me, it even happens when changing a phrase sometimes.
@Recep Baltaş did you find a fix or a solution in the meantime? You said this problem did not exist on older versions, do you remember which versions were not affected by these slowdowns by any chance?
2.0 was OK. This started with 2.1. It is still the same more or less. We are also planning a server upgrade.
 
Top Bottom