문제

I have to setup a server environment for a web application. I have to use aws, and so far it looks good for that purpose.

I need:

  • a scalable Tomcat 7 webapp server
  • session replication!
  • a mongodb database cluster(?)

As far as I think it could work with:

  • The scalable Tomcat 7 I can do easily with elastic beanstalk.
  • The session replication could work with elasticache
  • It seems like I have todo the mongodb cluster "manually", so I created some ec2 instances todo so.

I have some problems with that.

  1. the costs would be quite high. The minimum setup would be 2 ec2 instances and one for the elasticache
  2. The only thing, which autoscales, is the elastic beanstalk, means that I have to take care of that, too. (Well, for the mongodb instances, I could use a balancer, too)
  3. In case of the mongodb ec2 instances, I need to setup each instance by myself

Do you have any idea how to:

  • lower the costs (Especially in the beginning, it would be a little much, no?)?
  • make the administration easier?
도움이 되었습니까?

해결책 2

Autoscaling for your web server is easily done with Elastic Beanstalk, but you can use it independently. Check out the documentation for autoscaling here: http://aws.amazon.com/autoscaling/

It has couple of features that will help you save most of your computation costs;

  • one is the ability to scale out (and most importantly in), by changing automatically the number of web server you are using, based on your load. You can define the minimum number (for example, 1) and the maximum number. The system can watch a set of metrics (number of requests, CPU load...) and decide when to add or subtract instances.
  • the second is the ability to change the scale policy and increase or decrease the size of the machines, based on your usage. You can use medium size instances and switch to large or extra large ones, if you find it more cost effective. You are encourage to try out different sizes to see what fits you best.

Using Elastic Cache, can help you both in the session replication, but also to lower the load on your DB machine. You can cache there your frequent queries output (front page, main category page...), and get better performance, and use fewer DB instances. It supports Memecached clients, which makes it very easy to develop in almost any programming language.

You should check Couchbase instead of MongoDB (see comparison). It is more robust and more reliable in scale.

다른 팁

If you install mongo, have a look at: AWS_NoSQL_MongoDB.pdf. It is very customary to have one member of the replica set outside the availability zone you use, or even outside of the same region, so you can have a hot backup in case of a failure.

About prices - experiment (load test) and find the smaller instance type that fits you. Also, remember to shut down unused instances

About management - there is the AWS console and many 3rd party products. Also, Netflix have released some nice management tools.

Elastic BeanStalk is the best to reduce the over head of management for Web/App servers. However if haven't taken the development too far, I would recommend to use DynamoDB for the administration easement aspect.

However keep check on cost as well. Performance and Management is something really awesome in DynamoDB

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top