Adding more Amazon EC2 instances in response to demand

You can use Amazon to adjust your ArcGIS Server deployment in response to user demand. You can add multiple ArcGIS Server EC2 instances to your deployment and connect them under an Elastic Load Balancer (ELB). As demand increases, you can add more instances, either manually or programmatically.

The Elastic Load Balancer and ArcGIS Server scaling

If you need more power than one EC2 instance can provide, you can scale out your deployment by creating identical EC2 instances (using a custom AMI) and placing them under an Elastic Load Balancer. All requests to your server go through the load balancer, which then evenly distributes the requests to the available EC2 instances.

The AWS Management Console contains a Load Balancers link, where you can view your existing ELBs and add new ones using a wizard. You can add and remove instances from an ELB at any time by viewing the load balancer properties and updating a series of check boxes next to a list of instance names.

The traditional ArcGIS Server strategy of adding multiple SOC machines to a SOM machine is not supported for ArcGIS Server on Amazon EC2. Instead, you add multiple EC2 instances containing the SOM, SOC, and Web server to the Elastic Load Balancer. This type of scaling requires identical data and service configurations on each EC2 instance, but this occurs naturally if you use the same AMI for any EC2 instances you add.

Monitoring your deployment

Suppose you maintain a public-facing Web map application that displays natural disaster information from a state government. This site normally receives 500 visits per hour; however, when major weather events occur, such as tornadoes or flooding, the site receives up to 10,000 visits per hour. You don't want to maintain enough hardware (or even EC2 instances) to always be able to support 10,000 visits per hour, but your site needs to be able to handle this load on random occasions without slowing down.

The first step in scaling out your deployment is to monitor the load on your server. This is not always necessary if you have a pretty good guess of when the traffic is going to occur; however, with events such as tornadoes, you may not have much of a warning. Amazon CloudWatch is a service that you can use to understand the amount of work being done by your EC2 instances. CloudWatch gives you charts of instance usage, and it also provides metrics through optional APIs.

CloudWatch is an option that you must explicitly enable on EC2 instances that you manually create. Amazon charges a fee for using CloudWatch. If this is a concern, you can devise your own ways to track certain metrics on your instances, such as CPU and memory usage.

Adding more instances

If you detect that your deployment is overworked, you can create additional EC2 instances to add to your deployment. Conversely, if your deployment is underutilized, you can remove instances to cut costs. You can adjust your number of instances either manually or automatically.

If you want to add and remove EC2 instances automatically, you can use the Amazon Auto Scaling API. This API monitors your EC2 instances using CloudWatch behind the scenes. It can create EC2 instances when your server reaches a certain threshold of use, and terminate them when usage goes below a certain threshold. When you create new instances, you should use a custom AMI that you've preconfigured with your own data and services.

Any machines created by Amazon's automatic scaling have CloudWatch enabled, and the corresponding fees will apply.

Deleting EBS volumes after terminating instances

When you terminate an instance, the Amazon Elastic Block Store (EBS) volumes attached to that instance are not automatically deleted. If you are not going to re-use the volumes, you should delete them to avoid incurring unnecessary charges. One way to accomplish this is to use the EC2 API to check for EBS volumes with a status of Available and delete any available volumes found. You can perform this check at regular intervals.

Increasing your Amazon instance limit

If you plan to run many EC2 instances on your deployment, check your Amazon account to understand the number of instances you are allowed. Most accounts are limited to 20 on-demand or reserved instances and 100 spot instances per region. Amazon provides a Web form that you can use to request a different limit for your account.


1/30/2013