Muffinresearch Labs by Stuart Colville

Large Temporary Files Left Behind by ImageMagick | 0 Comments

Posted in Code, performance on 18th January 2009, 4:40 pm by

Recently since moving the CSS Sprite Generator to a new server we’ve had a couple of cases where the site has stopped working due to running out of disk-space.

The cause was due to some epic temporary files being left behind by ImageMagick:

-rw-------  2.7G Nov  1 10:25 magick-XX27JoRr
-rw-------  3.8G Nov  1 08:49 magick-XX3Ta6P6
-rw-------  1.7G Nov  1 07:22 magick-XX8uxqCS
-rw-------  3.8G Nov  1 08:54 magick-XXzm6nUD

I decided to up the max-execution_time in php.ini as I’d seem some comments that if the processes interacting with imagick are interrupted it can cause the temporary files to not be cleaned up.

max_execution_time = 120

In our case we’re using the imagick library for PHP, but it’s worth bearing in mind that this problem could potentially occur with any other interface to the ImageMagick libaries.

Since doing this, the problem has not re-appeared.

Post Tools

GNU screen: open tab in current working directory|(1)

A nice trick for having screen open a new tab in the same directory as the one you’re currently in. To use it add it to your .screenrc

# Open new window in current dir.
bind c stuff "screen -X chdir \$PWD;screen^M"
bind ^c stuff "screen -X chdir \$PWD;screen^M"

Hat tip: mteckert on SuperUser.com

Ubuntu: add-apt-repository: command not found|(3)

When you’re using a minimal Ubuntu install if you find the ‘add-apt-repository’ command is missing (it’s useful for adding PPAs and other repositories), then simply run:

sudo apt-get install python-software-properties

Photos on Flickr

© Copyright 2004-12 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.534s.