0

Hello Serverfault members.

I want to achieve the following setup on EC2: A load balancer starts and stops instances which only serve static content. (a javascript based application) I do not want to manually update the code of the application on the currently running instances if I release a new verision. So I thought about uploading the code to a cdn and mounting the drive with local cache on the webserver instances (dropbox like). this way any running instances would have automatically the latest version and the speed advantage of local content.

what is the best solution for this?

I have tried using s3 and s3fs / s3fs-c but because of bugs in their current implementation they are not usable for me. theoretically, would the temporary caching of s3fs be what I want to achieve?

McFarlane
  • 113
  • 4

1 Answers1

0

If it's just a static site you could serve up the content directly from S3, or via CloudFront if you'd like the advantages of a CDN.

CloudFront is trivial to set up and will negate the need to have a load balancer at all. You also get the added advantage that content is served by the edge server closest to the client.

All you need to do is:

  • Set up a CloudFront distribution in the AWS console.
  • Point the CloudFront "origin" to a DNS alias of your server or your S3 bucket.
  • Point your site DNS to the CloudFront end point.

Cloudfront will initially pull pages from your site then serve them from its cache till they expire.

ianjs
  • 410
  • 2
  • 6