Skip to content

Commit

Permalink
Merge pull request #19 from zalando/feature/sizing-advice
Browse files Browse the repository at this point in the history
Wrote some chapters for sizing information and scaling up/down.
  • Loading branch information
feikesteenbergen committed Aug 27, 2015
2 parents 695ad9f + 7204a85 commit 5c7d4ed
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/admin-guide/scaling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Scaling up or down

At some point during the lifetime of Spilo you may decide that you may need to scale up, scale down or change other
parts of the infrastructure.

The following plan will accomplish this:

1. Change the CloudFormation template to reflect the changes in infrastructure
2. Increase the number of EC2 instances in your AutoScalingGroup (or: Terminate one of the streaming replica's)
3. Kill one of the replica's running on the old configuration
4. Repeat step 2 and 3 until all replica's are running the new configuration
5. Fail over the Spilo cluster
6. Terminate the replica (the previous master)

Only during the fail over will there be some downtime for the master instance.

If your databases' size is significant, these steps may take some time to complete. Optimizations of this process
(think of using EBS snapshots) are on the roadmap but not yet available.

47 changes: 47 additions & 0 deletions docs/admin-guide/sizing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Sizing your Spilo

As every use case of a database is unique we cannot simply advise you to use a certain instance type for Spilo.
To get some notion of what is available, look at the Amazon resources:

* [Amazon EC2 Instances](https://aws.amazon.com/ec2/instance-types/)

# Guidelines
We can however provide some guidelines in choosing your instance types.
Choosing an instances type has some basic parameters:

- database size
- database usage pattern
- performance requirements
- usage characteristics
- costs

## Costs
To have some notion of the costs of Spilo, we have calculated the costs for some possible configurations.

**Note**: These are costs for an individual instance, as a case study. All prerequisites (Senza, Etcd) are considered
to be available and are not part of the costs of Spilo.
These figures are meant to show the approximate costs, they *will* vary depending on your usecase and resource usage.

The following table shows ballpark figures of the raw costs of a single node of Spilo, as well as the Spilo costs when
using the default configuration of 3 members in the AutoScalingGroup.
The pricing information is taken from Amazon, and are for On-Demand pricing (August 2015):

* [Amazon EC2 Pricing](https://aws.amazon.com/ec2/pricing/)
* [Amazon EBS Pricing](https://aws.amazon.com/ebs/pricing/)

| EC2 | Storage | Monthly ($) | Spilo ($) |
|----------|---------------------------:|---------:|-------:
| t2.micro | 10 GB EBS | 11 | 33 |
| m4.large | 100 GB EBS | 111 | 333 |
| r3.2xlarge | (provisioned) 500 GB EBS | 664 | 1992 |
| d2.8xlarge | (RAID 10) 24 TB HDD | 4292 | 12876 |

## Database usage
For some types of databases the smallest possible instance available can be a good candidate. Some examples that
can probably run fine on t2.micro instances are:

* Very small (< 500 MB) databases
* Databases which are not queried often or heavily (some configuration store, an application registry)
* Proof of Concepts / Prototyping


3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ pages:
- Deploy spilo: user-guide/deploy_spilo.md
- Deploy etcd: user-guide/deploy_etcd.md
- Connect to spilo: user-guide/connect_spilo.md
- Administrator Guide:
- Sizing spilo: admin-guide/sizing.md
- Scaling up or down: admin-guide/scaling.md

0 comments on commit 5c7d4ed

Please sign in to comment.