Вопрос

We have a java application hosted at m.large ec2 server which in future requires high number of computations to be done, To be precise it is expected to have 10 million computations per day and each unit computation requires around 100ms, computation is of type of multiple processing at java code and then dumping to db, not like Write Once, Read Many. Which is the best way to balance the load? Options we have been going across is to instantiate ec2 servers by script as the load increases, but before we implement it, we want to have a solid suggestions from experts. Kindly provide any suggestions.

Это было полезно?

Решение

This may not be the right answer for you but certainly worth a consideration. You should define the metric and threshold for your application.

instantiate ec2 servers by script as the load increases

In above statement, you need to define what do you mean by "load"? what is the threshold that load should cross in order to say the load has "increased"

Once you have this information handy, check whether you can monitor these metrics and thresholds using AWS cloudwatch. If yes, then you can create an autscalling group where the autscalling will spin-up a new instance as soon as it told by the cloudwatch alarm that "the load has increased".

If you find that cloudwatch does not support your metrics, then write your own custom metric and have cloudwatch monitor it. Click here for custom cloudwatch metrics documentations.

Once you have your custom metric, then again integrate autoscalling and cloudwatch alarms to manage creation of new EC2 instances when your load increases.

In short, explore AWS cloudwatch alarms and AWS autoscalling.

This whole process assumes that you do have a fully-automated way of creating an EC2 instance along with your software stack. You can create a pre-baked AMI with your application stack OR you can install the application stack on the fly using tools like Opscode Chef.

Другие советы

Use a Platform-as-a-Service (PaaS) instead of manually creating machines and scaling them. This is more flexible for long-term use, and requires less scripting. There are some PaaS recommendations here: Looking for PaaS providers recommendations

Disclaimer: I work for Gigaspaces, developer of the Cloudify open-source PaaS stack

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top