Amazon Web Service Micro Instance - Server Crash

前端 未结 3 767
余生分开走
余生分开走 2021-01-24 17:31

I am currently using an AWS micro instance as a web server for a website that allows users to upload photos. Two questions:

1) When looking at my CloudWatch metrics, I h

相关标签:
3条回答
  • 2021-01-24 17:41

    If you want to stay in the free tier of AWS (micro instance), you should off load as much as possible away from your EC2 instance.

    I would suggest you to upload the images directly to S3 instead of going through your web server (see some example for it here: http://aws.amazon.com/articles/1434).

    S3 can also be used to serve most of your web pages (images, js, css...), instead of your weak web server. You can also add these files in S3 as origin to Amazon CloudFront (CDN) distribution to improve your application performance.

    Another service that can help you in off loading the work is SQS (Simple Queue Service). Instead of working with online requests from users, you can send some requests (upload done, for example) as a message to SQS and have your reader process these messages on its own pace. This is good way to handel momentary load cause by several users working simultaneously with your service.

    Another service is DynamoDB (managed NoSQL DB service). You can put on dynamoDB most of your current MySQL data and queries. Amazon DynamoDB also has a free tier that you can enjoy.

    With the combination of the above, you can have your micro instance handling the few remaining dynamic pages until you need to scale your service with your growing success.

    0 讨论(0)
  • 2021-01-24 17:51

    I had the same issue: As far as I understand the problem is that AWS will slow you down when you reach a predefined usage. This means that they allow for a small burst but after that things will become horribly slow.

    You can test that by logging in and doing something. If you use the CPU for a couple of seconds then the whole box will become extremely slow. After that you'll have to wait without doing anything at all to get things back to "normal".

    That was the main reason I went for VPS instead of AWS.

    0 讨论(0)
  • 2021-01-24 18:03

    Wait… I'm sorry. Did you say you were running both Apache and MySQL Server on a micro instance?

    First of all, that's never a good idea. Secondly, as documented, micros have low I/O and can only burst to 2 ECUs.

    If you want to continue using a resource-constrained micro instance, you need to (a) put MySQL somewhere else, and (b) use something like Nginx instead of Apache as it requires far fewer resources to run. Otherwise, you should seriously consider sizing up to something larger.

    0 讨论(0)
提交回复
热议问题