![]() ![]() The actual cache files are kinda temporary runtime data, so they are usually not stored with Git. How to delete image caches depends on the framework or CMS in use, maybe settings and even plugins. So if you still have issues with image transformations, please make sure to clear the caches first, so that the images can be re-generated. Now, there might be corrupted files on disk with your App already. Generated images are then cached on the local file system and will be available without any computing from there on. Image transformations are often only generated the first time a user calls a page containing images. Those caches now - after the incident was going on for almost a week - can contain corrupt files. Image transformation are usually cached on disk. To get rid of past failed transformations, your action might be required. We are still investigating this and are looking for ways to further improve the service further. More memory (bigger plan) or smaller source images can also help. The patch is not perfect, we still see few cases, with very large images that will still fail. Those two settings together (RAM & swap) have provided much better results in our testing. We also increased the swap size that ImageMagick itself can use. The default also increases from 64 MB to 128 MB. If your Apps runs on a bigger plan, it gets more memory for ImageMagick. ![]() Now, Apps are getting the maximum available memory for ImageMagick. A patch has been applied globally just recently. It offers much better use case coverage in the ImageMagick policies. We have investigated all kinds of settings. Only a small number of clients were affected by these issues, but for some of them issues were critical. Those error cases either have been generating the grey images or we simply saw hanging processes and 5xxx errors with no images at all in the end. We finally found out, that image transformations done on larger images coming in (>3000px each side) and relatively large images going out (>600px each side) tend to lead to errors. Sometimes, but not always, great abstract art like the examples above was produced. So we tried to find a connection between them. ![]() But one by one, more and more image transformation related issues appeared. We rolled out the update around a month ago (10th of Feb) and we initially did not see any issues, neither in our tests we did before nor in production after the update. It now seems to us, that something changed with the new ImageMagick version. One of the goals was to bring " webp" support □. We recently updated ImageMagick from version 6 to version 7. With Universal Apps, each ImageMagick process was limited to 64 MB of memory. The limits are designed to give each ImageMagick process a reasonable limit while still performing as expected. We therefore have been limiting ImageMagick memory usage with a "policy.xml" file for quite a while already. So we aim to bring a good solution for Universal Apps - a balance between performance and expected results. But setting this up requires extra efforts, which might be overkill for a standard website. With the Professional Apps we offer Workers to outsource such resource hungry tasks into the background. Image transforms should not make any user wait. You can try it at home: Transform images with any program and watch your CPU spike.įrom our point of view, in an ideal web application architecture, such operations should not be mixed with anything that happens on the frontend. Loading images in memory (uncompressed) requires a lot of RAM and processing and compressing them with ever advancing codecs will keep even the most modern CPU busy. Image transformation on the other hand are resource hungry by nature. Our Apps are designed as lightweight containers serving fast PHP processes. The GD Graphics Library is an alternative also available here. Whenever PHP does an image transformation, like when thumbnails are created, it is probably doing all the magic in the background with ImageMagick. You will most likely have been using ImageMagick for years. The combination of these two in PHP is so popular, you could call it a standard of the LAMP stack. It helps you to transform images, like from one size to another (big > thumb) or from one format to another (PNG > JPG).įor PHP there is an additionally interface, called "imagick" which is installed as an extension and exposes a programmable interface for ImageMagick in PHP. It lives as a ready-to-run binary in many operating systems. ImageMagick on fortrabbitĪs you know: ImageMagick is a very well known image transformation library which has been around for ages. This article provides some background about what happened. This article is likely outdated.ĭuring the last week we have had some trouble with ImageMagick. ![]()
0 Comments
Leave a Reply. |