Optimizing Scalability in the Cloud