Open aloco opened 1 year ago
I’d strongly suspect it’s Imagick leaking memory over Craft since that’s kind of what it’s known for.
Try putting a https://imagemagick.org/script/security-policy.php in place with some resource restrictions (including memory). Imagick doesn’t respect any php.ini resource settings, so that’s the mechanism you use to control how much it has access to.
@angrybrad We are currently being hit by this same issue on a site: (2 queue jobs are needed in order to process different jobs used on the site).
There's very little information to help debug this fix, which makes it hard to provide more details to help you debug/fix this issue.
Craft CMS 4.10.5 Kubernetes GCP
What happened?
Description
Not sure if this is a bug or just a matter of configuration. We are using image transforms for our assets, they are handled via queue. We noted, that the job
Generating pending image transforms
needs very long for 75 images and gets canceled due to queue ttr. We already set the limit to 6000 which is still not enough. I am aware, that image transforms are expensive and it´s ok that it needs some time, however, our actual issue is, that the job is not freeing up memory after transforming or checking an image. As soon as the job gets canceled (after 6000) the memory usage drops. To me, the memory usage chart looks like it keeps already transformed images open and moves to the next one. As soon as the job timed out, memory usage dropped back to normal.We are using this image:
craftcms/cli:8.1@sha256:1f972a7493e056a21bcc4604c0dd44c497797d9fd2fecb61f5919c263228f2ab
Steps to reproduce
Generating pending image transforms
Expected behavior
Memory on server should be freed, after an image within one job gets transformed before moving to the next image within the same job
Actual behavior
Memory on server grows until job get´s killed or server runs out of memory
Craft CMS version
4.2.0.2
PHP version
8.1.9
Operating system and version
Linux 5.4.144+
Database type and version
MySQL 10.5.13
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.0-35)
Installed plugins and versions
Blitz 4.2.1 CP Field Inspect 1.4.4 Empty Coalesce 4.0.0-beta.1 ImageOptimize 4.0.2 Redactor 3.0.2 SEOmatic 4.0.7 Sprig 2.3.0 Super Table 3.0.0 Typed link field 2.1.3-rc Vite 4.0.2