Skip to content

Instantly share code, notes, and snippets.

@tvcam
Last active December 26, 2018 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvcam/2c5f2dc88fd6fa44cff8dcc87e2bc566 to your computer and use it in GitHub Desktop.
Save tvcam/2c5f2dc88fd6fa44cff8dcc87e2bc566 to your computer and use it in GitHub Desktop.
Don't use RMagick
I worked for a client where I have to generate an image version to be display in frontend (old code use original image which size ~6MBx40images for a gallery). I added a new image version in ImageUploader class then run a background job to reprocess large version. The website keep crashing every 20mn, after the whole day debugging the job, debugging sidekiq, trying uncached query, result still the same.
After a whole day I found the issue, it caused by RMagick. I migrate to MiniMagick which is a replacement for RMagick.
https://github.com/minimagick/minimagick
"I was using RMagick and loving it, but it was eating up huge amounts of memory. Even a simple script would use over 100MB of RAM. On my local machine this wasn't a problem, but on my hosting server the ruby apps would crash because of their 100MB memory limit."
So choose a gem carefully!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment