0

I'm creating a php application that needs to be able to scale up to "1 million users". I know this question is subjective to the application, but I'm curious what type of generic setups are a best practice.

Currently I've setup an Amazon EC2 Mysql Cluster DB, and have 2 web application servers load-balanced.

As users and load increases, I am planning to increase the power of the EC2 instances, then as needed, add new instances of the application and MySQL servers.

Is this a standard approach to the problem? How do companies like Foursquare, Facebook, etc. handle scaling their IT infrastructure?

Aliaksandr Belik
  • 259
  • 6
  • 17
Matt B
  • 1
  • 2
    it doesn't seem like you really know what you want exactly. My suggestion would be to come up with a concept that actually requires servers to support a million users (not in theory, but in actuality) then worry about the tech. This is basically how every successful website you mentioned has worked their situations. – Chris S Nov 11 '11 at 19:59
  • I can certainly respect your angle on the question, however we're at the stage where I'd rather look at infrastructure configurations that people have GOTTEN to, and not repeat how they GOT there? I know every situation is unique, but some things ultimate end up in common and I want to get some hindsight on what others have done in the past, so I can do my best to avoid the pitfalls – Matt B Nov 15 '11 at 16:22

1 Answers1

2

I run several PHP sites out of Amazon currently. I have an ELB configured in front of the EC2 instances handing the PHP application. I then have an ElastiCache cluster to ease the database hit from the app. Finally I utilize a multi-AZ RDS MySQL instance for the database. As load increases I can increase the number of EC2 instances behind the ELB. If database calls are slowing I can either add additional nodes to the ElastiCache cluster or fire up RDS read-replicas for read-only queries.

With this topology you should be able to scale an application to handle however many users you desire. Just season with whatever monitoring you feel necessary to determine when load has escalated enough to require growing the environment.

Jeremy Bouse
  • 11,341
  • 2
  • 28
  • 40
  • It seems like the only difference between the setup I've described is I need to do some more homework on both the ELB / Elasticache cluster. I setup the MySQL Cluster DB so I could get the simultaneous read/write/redundancy, but perhaps your setup has different merits I haven't considered yet. – Matt B Nov 15 '11 at 16:24