Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Problem:

Our REST API is for requests for static images and requests for other computationally intensive tasks, such as rendering new images.

We noticed that our Apache-Django server gets bogged down on some rendering requests, and thus is unable to fulfill the more frequent and simple static image requests.

Basic outline of a solution:

Server 1 parses the URL requests and decides whether if the request is a static image request for passing to Server 2 or rendering request for passing to Server 3.

Server 2 and Server 3 then send the response back to the client.

We use AWS.

Questions:

Should Apache-Django be used for all servers above?

Should CloudFront be considered an alternative for Server 2?

Can Server 1 be handled by somehow extending AWS Load Balancer?

What more should I research?

share|improve this question

1 Answer 1

CloudFront isn't going to buy you much if every request has to hit your server first. However, CloudFront recently gained support for dynamic content, so you could setup your service based on this.

CloudFront would be the entry point for all incoming requests. Static content would be stored on S3 (with appropriate Expires headers), and CloudFront configured to serve static content from S3. Dynamic content would be served from your EC2 instances (with immediate Expires headers) and CloudFront configured to serve dynamic content from these servers.

share|improve this answer
    
Can you please elaborate on this statement: "CloudFront isn't going to buy you much if every request has to hit your server first."? –  indiehacker May 18 '12 at 17:11
    
The whole point of CloudFront is to serve and cache your content closer to the clients. If every request has to go through a server (or set of servers) in a single location then it's not going to improve performance. –  mgorven May 18 '12 at 17:35
    
That makes perfect sense...thanks. –  indiehacker May 18 '12 at 17:36
    
So to conclude, using the CloudFront framework, I could have some specified set of URL requests, which are only for static images, go to S3 buckets of the images, and all the rest of the requests be re-routed to our regular EC2 server. Correct? –  indiehacker May 18 '12 at 17:43
    
Yes, that is correct. –  mgorven May 18 '12 at 17:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.