Image improvements with the Amazon Cloud

We were having some major issues with image resizing. This was entirely my own fault as in my last game I used my digital SLR camera which produces images that are around 7MB. So I increased the upload limit from 5MB to 8MB.

What I did not account for was the memory issues this would cause when you tried to resized 12 images of 7MB each. It was crashing the server and having an impact on the overall site.

I contacted my hosting provider and asked if there was anything they could do. But there wasn’t really and they suggested using Amazon’s EC2 virtual servers to do the heavy lifting of image resizing.

So I gave this a go and it’s worked. Images are now stored on the main server but requires to resize them to the varying sizes are now handled elsewhere on EC2.

The benefits of this are two fold. The first is that the main web server is now free to serve the HTML of the site as quickly as possible without being bogged down by image resizing. The second is that because another server is handling the request elsewhere when you upload images you get the page back much quicker. The other server then resizes the images independently and loads then as they finish. You can then continue editing your report instead of always waiting on the image upload.

  • http://iToysoldiers.com/ Rob @ iToysoldiers

    I’ve been giving some thought to using AWS as well. What’re your thoughts on getting running with ’em? Easy? PITA? A fellow dev gots to know.

    • gamemaster

      Their EC2s are essentially blank boxes so I had to instal Apache, PHP, MySQL, etc. Then configure them. I use a VPS from ServerGrove for my web sever. The EC2 is a scalable solution to the image issue. I also just wanted to do it for kicks :-)

    • cadianshock

      Their EC2s are essentially blank boxes so I had to install Apache, PHP, MySQL, etc. Then configure them. I use a VPS from ServerGrove for my web sever. The EC2 is a scalable solution to the image issue. I also just wanted to do it for kicks :-)

      • http://iToysoldiers.com/ Rob @ iToysoldiers

        Yeah, their ability to scale up is what appeals to me. My solution to the same problem (processing images) was to kick up the php memory limit to 756mb. It works but I’m trading for the number of httpd processes I can run. I’d like to run at least two servers to handle my infrastructure needs. I NEED MORE TIME! *snicker.

        • cadianshock

          I’ll email you. I can share the code with you, one file plus the image of the EC2 machine so you can effectively use it with no set up time :-)

          • http://iToysoldiers.com/ Rob @ iToysoldiers

            Oh, well that’d be grand!