RMagick thumbnail creation fails

software development

#1

Hi,
I was using other hosting service, and recently moved to Dreamhost.

I found out that when I upload an image file and then try to create a thumbnail using RMagick in my rails app, it fails(no error returned). I’m using attachment_fu plugin.

I tried to create a thumbnail manually from the rails project console, and whenever I load an image using RMagick, a few seconds later, my console is killed.

I think some Dreamhost process is monitoring ruby processes and kills it when it uses large memory.

How can I solve this problem and create a thumbnail without any error?

Thanks in advance!


#2

Doesnt seem to be the case. I doubt it’d kill a process for creating a thumbnail, as several different programs out there do it.

http://wiki.dreamhost.com/index.php/RMagick - check here, try upgrading your rmagick install.


#3

I ran into a similar issue using ImageMagick’s convert program from a shell script.

I asked, but didn’t receive any guidance on what the various limits of CPU/Memory are that gets a process killed. Apparently, it also has to do with the load average of the host you’re on.

So, I think the politically correct answer is that you should create thumbnails on your local machine and upload them to the host for display.

My solution broke things up into the smallest tasks possible, and queued jobs to a temporary directory with a crontab that would continue trying every few minutes until it succeeded. Eventually, I’m planning on reading the current load average from /proc/loadavg and avoid launching such a task under high load averages.

Of course, I was just prototyping some code, and would probably go with a private server for production code so as to guarantee a certain level of service to my customers.