User Theme Selection Broken and Causes Performance Issues?


First off thanks for how amazing Discourse is and we love it since migrated from bbPress plugin (migration wasn’t smooth but thats for another topic).

One of the users in my discourse site noticed that when trying to select a different theme under his profile it was displaying broken (screenshots attached). However I could not reproduce the broken template scenario as they were loading fine on my side as admin.

But the intriguing part is that I thought our community was somewhat heavy in traffic/users (49k posts 7.3k users) that the VPS (2GB ram + 2GB Swap and 1 CPU) could not handle it and somehow we had a bottleneck that was causing the site to be loading very slow (some pages taking from 3-10 seconds to load showing the spinner).

I have been using Grey Amber as default and had Dark and Light by default as being able to be selected by users.

So I decided to disable the Dark and Light themes for users and all of the sudden the site became snappier and almost as fast as Meta.discourse!!! Now and other page test sites display insane fast times with some even under a second. Even backend pages like sidekiq, logs, upgrade, etc. were really slow loading before this, now is like almost instant. I have not tried yet, but I wonder if upgrades might even work now through the UI as they were hanging/cancelling or throwing errors, etc. OMG wow, even the upgrade by interface works now… I have been having to do it through the terminal and having the site down for like 20-30 mins, I guess no more!

Is this a normal behavior that disabling or putting themes to inactive you get a boost in performance? My guess is no, but is what I encountered so far even after rebuilding the app several times.

Running: v2.4.0.beta1 +135 157 (upgraded as typing this just to test if it work through the interface and it did, amazing)
S3 Backups
Header Links Theme Component (site was slow before adding this also)

The DNS is Cloudflare but I know better to have disabled all the optimizations/cache and brotli, etc. It is very fast now and no problems under same Cloudflare settings, only thing that change was disabling the themes.

I apologize if is a long post, just trying to provide as much info in case it helps anyone or for debugging.

The user took screenshots that I attached of how it looks on the browser when selected Dark or Light:

When this happens, is there anything that shows up in the browser console or /logs? The slowness on Sidekiq and Logs likely wouldn’t be caused by a theme (grey amber is really just a color scheme at that anyway, so no major modifications there).

I cleared the logs, enabled the themes again for users to select them and I preview it under mine and didnt see anything on the browser console.

On the logs it showed this but is probably unrelated:

TypeError: t.forEach is not a function
Line: 3
Window Location:

It could be that your server was swamped doing some kind of image manipulation and that it’s finished now.


Maybe you are right. Could be some processing that makes the CPU spike at 100% for awhile and slows dow everything else. Funny thing is that it must of being very coincidental that its being acting like this for weeks and all of the sudden I changed that setting and it became butter smooth lol.

Another unsolved mystery :stuck_out_tongue_winking_eye:

Or maybe some of the commits fixed something since the last rebuild I did. The most amazed I am is that I can upgrade through the browser now and makes me very happy :+1:


This topic was automatically closed after 6 hours. New replies are no longer allowed.