Scaling for the Holidays Part 1: To Scale Vertically or Horizontally?

Filed in Product & Development by Angela Bartels | October 17, 2011 9:26 am

When developing your application from the ground up, keep scalability in mind. Your application may run perfectly on your desktop or even after you’ve launched on the Cloud[1], but how will it run when you receive a swarm of visitors trying to access your application at the same time?  You can always upgrade on the fly in the Cloud, but there will always be a cap. It’s important to think about a strategy for growth before you launch into production.

For example, will it be easy to scale MySQL once you hit the I/O, CPU, or RAM ceiling for your application?  Would it make more sense to take a NoSQL approach and use something like Cassandra[2] or CouchDB?

For serving web pages, do you want to use Apache? Do you want to use something a little more lightweight with fewer features? Think about what your application does and decide if the web server you’re using is overpowered (or underpowered) for what you’re doing.

Horizontal Scaling

Scaling horizontally means adding more instances to your pool of machines. When scaling horizontally, you have to look at what the load balancer can do. Rackspace Cloud Servers[3] caps the throughput on the outbound network (no cap on inbound traffic)[4]. On a 256MB instance, you receive 10MB/sec of throughput. If every request is 1MB of traffic, it doesn’t matter how many machines you have, your instance will cap at 10 requests.  You can have 20 machines but can’t do anything because the pipe isn’t big enough. Be sure you size your load balancer correctly.

To get around that, you can use Rackspace Cloud Load Balancers[5]. Part 4 of this series will cover this topic.

Vertical Scaling

To scale vertically means sizing the web server with enough memory (up or down), whether it’s a single instance at 256MB all the way up to 15.5GB, capped at outbound bandwidth.

This is a good tactic for developers who don’t have the system administration skills or desire to manage multiple servers. Choose the instance most appropriate for your application from the beginning.  Because it’s all shared, you will run into limitations running your I/O, memory, CPU on a single instance. Things like Apache and MySQL would have to share resources.

Some frameworks require more memory than others, so vertical is better. Application data, like Cassandra or Drizzle, take a lot of overhead and might go from 8GB to 16GB.  Make sure you have enough room to run your applications.

If you’re in the Cloud, features like burstable CPUs based on instance size are available on Rackspace Cloud Servers. We have dedicated performance based on each instance size giving you more I/O, CPU, and memory.

Stayed tuned for Part 2 of our Scaling for the Holiday Series[6]: Take Advantage of Caching.

Endnotes:
  1. Cloud: http://www.rackspace.com/cloud/
  2. Cassandra: http://www.rackspace.com/cloud/blog/2009/09/23/the-cassandra-project/
  3. Rackspace Cloud Servers: http://www.rackspace.com/cloud/cloud_hosting_products/servers/
  4. throughput on the outbound network (no cap on inbound traffic): http://www.rackspace.com/knowledge_center/Frequently_Asked_Questions#Is_there_a_throughput_limit_on_my_server27s_network_interface_card3F
  5. Rackspace Cloud Load Balancers: http://www.rackspace.com/cloud/cloud_hosting_products/loadbalancers/
  6. Scaling for the Holiday Series: http://www.rackspace.com/cloud/blog/2011/10/17/scaling-for-the-holidays-a-four-part-series/

Source URL: http://www.rackspace.com/blog/scaling-for-the-holidays-part-1-to-scale-vertically-or-horizontally/