Saturday, 9 January 2010

Uploading images

I spent quite a bit of today just uploading photos to my photo website. But when I uploaded a pano image, it caused my account to go way over it's memory limit, and so all my processes got terminated. The image was 10616 x 5308 pixels (161MB uncompressed), and the php process that was resizing the image spiked to 879MB memory usage before my webhost killed it (along with the rest of my processes).

After restarting my processes needed for my websites to function, I thought I'd better hold off uploading any more images for the moment. My D200 images are 3872 x 3592 pixels (28.7MB uncompressed), so if the image resizing process uses 5½ times as much memory as the uncompressed image takes up, this would mean that even resizing a D200 image would put me quite a lot over my memory limit.

Now, I'm sure I should be able to resize my images on the server without the resize process taking up 5½ times as much memory as the uncompressed image. So I need to do some testing in my local environment to try and find why the resize process is using so much memory. I found that the top -d 1 command can give you a useful output on how much memory different processes are using (-d 1 tells it to refresh the data every second).

But I couldn't really run the test on my Ubuntu virtual machine as I was using apache + suPHP, whereas the webserver is running Nginx + php fcgi. So I needed to reconfigure my Ubuntu Virtual Machine to more accurately mirror the setup on the webserver (my current Ubuntu Virtual Machine configuration is based on the setup that my old webhost evohosting used).

I started by changing Apache to listen on port 8080 instead of 80, and then disabled all the sites on it (sudo a2dissite sitename). I downloaded the latest stable version of nginx, and that's as far as I've got so far, I'll have to continue tomorrow.

In the afternoon I also played on Colin McRae Dirt a bit.

And in the evening I also watched Mauser play 1 vs 100 (expect it wasn't), watched an episode of Power Rangers with L, and watched 'The Killing' with Mauser and Clare.

Food
Breakfast: Bowl of Maple & Pecan Crunch Oat Cereal; Cup o' Tea.
Lunch: Arran Mustard Ham with Sweet & Crunchy Salad Sandwich made with Fresh Bread-maker-made Bread; Crust of Fresh Bread-maker-made Bread with Berry Jam; Clementine; 2x Posh Chocolate Biscuits; Cup o' Tea.
Dinner: Piece of Toad in the Hole; Potatoes; Green Beans; Swede; Ground Black Pepper; Gravy; Mustard. Pussing was Home-made Lemon Meringue Pie with Squirty Cream. Coffee; Cherry Liqueur; Piece of Sainsbury's Mint Creme Chocolate.
Supper: Fox's Choc Chip Cookie; Shortbread Finger; Cup o' Tea.

No comments: