Image processing performance #2507
Replies: 5 comments 3 replies
-
Hi @celsojr-websters, this is not a performance problem with Twill itself as you correctly identified. Glide is a dynamic image rendering service, so what you're observing is expected. Can you clarify what very large images means in actual filesize/resolution though? Which Glide driver are you using? GD? Imagick? Ultimately PHP is not the most efficient for image rendering, and that's why Twill also supports third party services for that. But you can also scale with Glide by dedicating resources for it instead of consuming server capacity that you need to actually serve other requests. Glide is also supposed to only render once, and if you have Cloudflare on top, your origin shouldn't need to render images that often. It is also possible to warm your Glide cache if your various query parameters applied to image URLs are known upfront. I totally understand what you are saying about WordPress and many other CMSs that don't have dynamic rendering but rather are generating a bunch of predefined thumbnails at upload time. Twill allows contextual cropping, so this approach isn't necessarily ideal. Also, responsive images implementation sometimes do need the dynamism to avoid having to regenerate all the thumbnails just to change something minor on the frontend. I'm still open to considering a new service that would generate predefined resolutions if that can help. |
Beta Was this translation helpful? Give feedback.
-
Please share actual numbers when reporting something like this. "High" and "large" can mean very different scale for different people. |
Beta Was this translation helpful? Give feedback.
-
I think you are wrongly accusing Glide when the problem is with your implementation. On your homepage, you are correctly applying the See the The resulting image is 331kb vs 72k when w=1400 is correctly applied: https://thehealthyhome.me/img/a0e2ccdb-7d51-4607-ac32-40ea3d2b243c/exp-seamless-moving-experience-with-premium-movers-in-dubai.jpg?fm=webp&q=85&fit=max&crop=4096%2C2731%2C0%2C0&w=1400 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I'm reading this just now
And
Glide 2.0 or future development But, despite those are old issues never fixed, it seems they agree with me. And by this, of course, I'm not saying you disagree. We will probably scale our VMs this time, but hopefully the future is gonna be brighter. Also, if we come up with some sort of custom solution, I will try to come back and share. Some problems will only rise when storage is full of high resolution images, so I don't think it will be a big problem for everybody. As you said before, It's true that PHP is not the most recommended option when it comes to performance for image rendering nowadays, I would go with C/C++ or Rust. But I must admit it still scales very well in most scenarios, at least in the beginning, with no or low cost. |
Beta Was this translation helpful? Give feedback.
-
I have been working with Twill CMS for about two years and we are starting to experience issues related to the performance of the image service.
We are currently using Glide. But the problem is that users are uploading very large images to make them clearer. And this requires a lot of server resources, both CPU and memory, to process these images before rendering them.
I remember that in WordPress projects we had no performance problems, even when trying to upload very large images. I think this is because WordPress is not processing all the images in real time. But instead, it saves cropped and resized images to the file system. I mean it will crop and resize images in one go and never bother the server again.
We are already using a high-performance VM from Amazon and also caching resources with Cloudflare, but it is still not enough.
Has anyone here faced a similar problem? Do you know if it's possible to have an image service similar to what we have in WordPress with no or minimal impact on the frontend?
P.S.: I know there were performance improvements in Twill CMS in version 3+. But the Twill CMS version 2.5.3 is good enough for us. I believe the problem is just the imaging service now.
Ref.: https://twillcms.com/docs/media-library/image-rendering-service.html
Beta Was this translation helpful? Give feedback.
All reactions