XF 2.2 Is there a way to make it so that updating widgets and templates does not crash an active site?

Jawsh

Active member
Since XenForo 2, updating any widget or any template seems to cause every subsequent request to try and recache the entire sites templating until the site grinds to a halt and crashes until at least one of those requests recaches the templates. It is no longer possible for me to tweak things on the fly or swap featurettes in the widget area.
 
Do you have any add-ons installed? Have you tried disabling them? It sounds like to me is that an add-on is interfering with the save process for templates.
 
What are th3e specs for your hosting?
24 cores 3.2 GHz, 16G RAM, LXC, RAID 10 SSD
Site receives about 100 requests per second on average.

Do you have any add-ons installed? Have you tried disabling them? It sounds like to me is that an add-on is interfering with the save process for templates.
Only official XF add-ons, ThemeHouse's UIX, and custom add-ons I know do not touch this code (and which this issue predates). As my site has grown larger, the downtime from any templating / widget change has increased.
 
Make sure you have caching setup (memcache or redis, as ACP is a waste of time). This somewhat helps.

But ultimately the issue is the style cache invalidation stick is entire-site wide and hits every style and causes performance issues
 
Updating templates does require the CSS to be reevaluated most notably, but this is normally something that should only take about a second (or two) to really process, unless there are add-ons/styles that are adding a significant amount of CSS that are slowing down that process.

It sounds like a cascading failure type of situation where the higher load from this process pushes the server load over the edge. That makes me wonder if you're close to that type of point as is, though it's hard to say. I don't really have a particular recommendation as any change would really be a significantly different approach.
 
Updating templates does require the CSS to be reevaluated most notably, but this is normally something that should only take about a second (or two) to really process, unless there are add-ons/styles that are adding a significant amount of CSS that are slowing down that process.
Why can't the old stylesheets be sent until the new ones are ready? Why can't this be done on CRON?
 
Part of the issue is XF2 refuses to hit the cache for requests asking for old CSS (in limited cases). It is somewhat over eager on discarding the cache entries
 
Last edited:
1604419171685.png
1563 rows in set (0.003 sec)

1000 rows of this as the site chokes and dies for 10 minutes straight every time I want to fix a typo in a widget. There needs to be system where a user cannot trigger a stylesheet rebuild. It should only be done through admin requests and the cron.
 
Updating a XF widget or template is only something an admin can do. Without add-ons, normal users can't do this.

My redis cache add-on contains a work-around for the "thundering herd" behaviour which hits xf_css_cache by instead storing short lived template fragments in the cache system instead of an XF table.

Just having a caching system setup is a massive performance benefit for XenForo.
 
Top Bottom