Fixed After Upgrading from 1.5.20 to 2.2.1 MG 2.2 loads totally slow 20sec+

RobaFresca

Active member
The upgrade self was seamless and it's all fine but a click on "gallery" gives everyone a "little break" of around 20 seconds.
It was extremely fast before on 1.5.x with MG 1.x as i run it on a VPS with 10cpu, 60gb ram and SSD only with 1gb network in a modern 460gb network datacenter.
Forum runs on PHP 7.4.11 FPM/nginx and nginx proxy. It's all lightning fast but the first loading of the gallery (always on click).
i experienced that even on my testing-clone before so it is reproducable.

Tried also indexing all again and switch off niginx and on again to delete cache. No change.

Btw. we have 40k+ images in the gallery.

Hope there is soon a solution.

THX
 

Chris D

XenForo developer
Staff member
I've moved this out of bugs for now. First of all, we have a separate XFMG bug reports forum. Secondly, I don't believe this will be a bug anyway, but we can hopefully at least troubleshoot it a bit more before we ascertain that.

40,000 images in the gallery isn't significant in the grand scheme of things and we definitely have customers with much larger galleries.

Structurally, the media gallery is not particularly different from MG 1.x.

So such a slowdown is unexpected.

I have registered on your forum. If you could approve my account and make sure I have access to the media gallery that would be appreciated.

It might be useful too if you could temporarily enable debug mode in src/config.php which will enable us to see what the root cause of the slowdown is.
 

RobaFresca

Active member
Thx Chris for checking. Account approved. If you need more rights e.g. admin/superadmin just let me know.
Debug mode is on now.
 

Chris D

XenForo developer
Staff member
Thanks.

I've tested it a few times and it does seem to often go over 10 seconds.

I think there might be a database table index missing or, perhaps, even an index that isn't supposed to be there.

Are you able to run the following query on your database directly and let us know the full output?

SQL:
SHOW CREATE TABLE xf_mg_media_item
 

Chris D

XenForo developer
Staff member
Thank you for the additional access to the server.

We were able to track down perhaps a bug fix we had made to XFMG 1.c three years ago that might not have made it in to XFMG 2.x.

I have applied this change to your site and it has gone from taking 18 seconds down to 0.01 seconds.

Hopefully this is slightly more acceptable!

Can you please confirm this now functions correctly?
 

Chris D

XenForo developer
Staff member
No worries.

Please note that until the next XFMG release you may see a notice in your admin control panel about files not having the expected contents.

This is expected because I have changed one file on the server. The file changed is src/addons/XFMG/ControllerPlugin/MediaList.php so if you see mention of that it is safe to ignore.
 

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XFMG release (2.2.1).

Change log:
When displaying a list of media ordered by date, in some cases it is useful to MySQL to force a particular index hint in order to improve performance.
There may be a delay before changes are rolled out to the XenForo Community.
 
Top