Speed issues on website using imagemagick
Speed issues on website using imagemagick
I am working on developing a website with our developer that is utilizing imagemagick fairly extensively in regard to generating a lot of images on the fly, small simple image files. It is for a front-end that a user will manipulate using imagemagick, What I have noticed tho is that it seems as if imagemagick will only process so many items at a time possibly? When multiple users are on our site at the same time using the page features the image load times slow dramatically, some pages might have 20+ small image files generated on the fly at the same time, and if one user is on the site load times are tolerable, but when more users are on at the same time it slows down a lot. The site is coded in php and on a quadcore server with very little usage from other users and no real cpu or memory limits. Is there anything possibly that our hosting provider could change on the server side to make imagemagick run faster or allow more instances at once possibly? Thanks!
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Speed issues on website using imagemagick
Imagemagick as an image processor is actually a memory hog, as it loads the images into memory for processing.
If too many images are being processed, memory may become short, and the image will either start to 'thrash' as it writes memory to disk 'swap' space, or IM will start to cache images to temporary memory files.
I suggest you review the image processing scripts and try to reduce the number of images that the various IM commands keeps in memory. Single commands can still be used, but deleting intermedite images, and saving/deleting results as soon as possible may help reduceeach IM's memory foot print.
Adding more ram to the computer can also make a big difference but may also cost more money.
If too many images are being processed, memory may become short, and the image will either start to 'thrash' as it writes memory to disk 'swap' space, or IM will start to cache images to temporary memory files.
I suggest you review the image processing scripts and try to reduce the number of images that the various IM commands keeps in memory. Single commands can still be used, but deleting intermedite images, and saving/deleting results as soon as possible may help reduceeach IM's memory foot print.
Adding more ram to the computer can also make a big difference but may also cost more money.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/