Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

closed as not constructive by Chris S, Iain, MDMarra, mailq, RobM Nov 11 '11 at 20:25

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

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 Answer 1

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.

share|improve this answer
    
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

Not the answer you're looking for? Browse other questions tagged or ask your own question.