MoreGallery import serious webserver performace issue

Well, usually we don’t have troubles either. During years we have tested many different setups and approaches, so I guess we understand quite well underlying tech. While we fully manage our servers, we also take into account apache setup, fast-cgo config, user separation etc.

Our latest project that we run since this spring is a bit different. It’s Slovak Golf Association website, where some parts are public, so you can have a look: https://www.skga.sk/ (sorry slovak only at the moment). The core functionality is heavily based on presenting and editing all data aspects of playing golf in Slovakia (players, tournaments, resorts, clubs, handicap history etc.). This is implemented using REST API on external server, not really MODX stuff.

But there is also “editorial” stuff, like everyday news, documents and of course GALLERIES! We combine MoreGallery with Collections as I mentioned here Moregallery first image of the resource rendered in the collections extra? - #9 by hrabovec.
These galleries are uploaded by PR agencies usually after some tournaments, one or two per weekend. There is usually about 200 images, but for example this one Slovenská golfová asociácia have more than 500. This triggers more that 1000 concurrent requests for thumb generation (mgr thumb plus one 300x200 for front-end overview). Large images for lightbox we generate using phpthumbof, otherwise there would be even more trouble.
It also should be mentioned that it’s a big difference if someone uploads files coming directly from his DSLR (like 20Mpx), or process them in Lightroom or so to max. HD size. In this case limiting uloaded file size is not quite a measure, because filesize is dependent on pixel dimensions, bit depth and compression, while memory usage while processing the file is only dependent on pixel size and bit depth.
One possible optimization mentioned in docs is using mgr thumb directly in template or as a base for phpthumb. But it’s unable to setup custom mgr thumb generation (e.g. zoom-crop settings), so we need to generate extra thumb with own settings. And we also had trouble setting up correctly the large image generation in crop settings (but this is separate issue).

To sum it up: generating all thumbs and sizes on upload is generally a good idea, but devil hides in details. So if you can somehow implement queuing that would be great. We are here to test it heavily! :grinning: