Need help scaling photo sharing application

I currently have an application running on a single Linode 1GB. This is a photo sharing application (think Flickr i guess), so action involves serving static images, uploading images to the server etc. The app is normally pretty fast… until other users start uploading lots of photos.

During photo uploading, the application consumes a lot of CPU power as it uses ImageMagick to generate different sizes and Jpegoptim for compression of each photo. The site becomes unusably slow when 3 or 4 users upload images at the same time, and my server CPU usage goes way up. This basically renders the client facing side of the app unusable as well. Upgrading to a higher Linode plan is probably not the long term solution.

Off my mind, I am thinking of running another Linode dedicated to image processing. After processing, I can FTP the files to back to the client facing app server. Then as the app grows, I can add more servers along with a load balancer for dedicated image processing. As for storage, I am guessing I will eventually have to move onto something like Amazon S3.

Is this a feasible approach? Would upgrading to a higher linode plan solve this issue in the short term? Can someone point in the right direction in terms of architecture for scaling this out correctly? for both short term relieve and long term?

Thanks in advance.

1 Reply

Try ZeroMQ (www.zeromq.org). You can have any number of processing nodes that listen to a "message" (image processing task) from any number of front servers. Think master-master db replication only with messages. The messages are basically strings so you can encode them whatever you like, eg. a json string with processing params and the image itself hex or base64 encoded. Or whatever.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct