I am building a facebook app that will need to support tens of thousands of simultaneous users.

I am using linux, apache, mysql and php (LAMP) stack. I need to use a load balancer to so i can easily add more backend servers if demand changes.

I looked at nginx and HAproxy, but i am not sure what is the best solution. The primary requirement is that it needs to support PHP. Also, almost all the requests will be dynamic requests and make changes to the database.

Any admins there that can help?

link|improve this question
Your webserver won't matter at all if all the request goes to PHP and you do not serve things such as static files. You'll want to optimize PHP and then load balance across multiple servers. – Martin Fjordvald Aug 29 '11 at 8:38
1  
The performance of a (web) server depends on the OS, drivers, CPU, disks, RAM, NIC, usage patterns, the configuration and design of the applications. It's useless to focus on just one aspect of the equation. – Alex Holst Aug 29 '11 at 8:43
feedback

closed as not constructive by SvenW, mailq, Iain, jscott, Chopper3 Aug 29 '11 at 10:35

This question is not a good fit to our Q&A format. We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion. See the FAQ for guidance on how to improve it.

1 Answer

I don't have any nginx experience, but we've been experimenting with HAProxy for a new site and I'm pretty impressed with it; sensible health-checking on the servers that it's balancing across, sticky sessions, easy mechanism for removing individual servers for maintenance, it's got everything that we need to host our site, which serves about 9m pages to 120k users each month.

Either option should scale well; I believe HAProxy is used to run all the StackExchange sites, and there's no shortage of high-profile nginx sites, either. PHP shouldn't be a problem for either of them; all the load balancer will be doing is balancing requests across your servers (and possibly throwing cookies around), it's not concerned with what code your app runs.

link|improve this answer
feedback

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