Reputation: 1484
I have an application that does some image processing using rmagick and imagemagick. This image processing was being done in background job via resque and redis. The problem is that even just one worker who is doing image processing is eating up crazy huge amount of cpu. I have done some research and recompiled imagemagick with open mp disabled. Is there any other thing I could do to make the resource usage reasonable?
I am using a high cpu amazon instance with ubuntu 10.04 as the operating system.
Upvotes: 1
Views: 870
Reputation: 1484
It seems I have resolved the issue by doing the following:
I removed all traces of the ubuntu installed imagemagick packages.
dpkg --get-selections > installed-software
cat installed-software | grep magick
I then uninstalled all the ubuntu package that resulted from the above query. After that I recompiled imagemagick with open mp disabled and reinstalled the rmagick gem.
Upvotes: 1
Reputation: 17212
You might look to GraphicsMagick, a fork that focused on higher performance; some of their older benchmarks show the sort of performance gain you might see.
I have not repeated those benchmarks in recent times, so can't vouch for either their independence or their accuracy with the most recent versions. I can say that a couple of years back our observations matched that performance difference.
The only other useful direction is, if your images are suitable, looking for various algorithms that don't decompress the image. JPEG has lots of tools that can perform on the compressed data - substantially reducing both processing time, and memory consumption, compared to working on the decompressed data.
Upvotes: 1