Ask HN: Server Infrastructure recommendations for a PHP app
What would you recommend as a good server infrastructure recommendation for a PHP web application running on CodeIgniter and MySQL?
For an application with the traffic and size of, maybe, twitter?
13 comments
[ 2.9 ms ] story [ 46.6 ms ] threadSeriously, as your application grows, you'll improve your infrastructure. Nothing kills a project as easily as building an infrastructure for millions, for an app with only a few users.
You're going to have a very beefy load balancer, behind which sits a bunch of nginx installs and you'll have likely thrown CI out the window because, even though it's fast for a PHP framework, it's not fast enough for what you need. You'll be using PHP, likely with a few homebrew extensions written in C.
Or you could just use Node. It has non-blocking IO. :D
Realistically, write it on a crappy linode with the default MySQL install and your PHP framework of choice. If you ever get as big as twitter, you can worry about scaling up to that size then.
Please explain.
They offer on-demand scaling, and a very generous entry level pricing. Their free app is great for small tests and quick deployment tests.
Disclaimers:
PHP Fog and Orchestra.io use Git for deployment. You point your machine/instance to a repository and it will keep it updated when you commit and push changes.
These services are built with scalability in mind (read: multi-server or variable performance single server). So, it's encouraged that you have a solution for hosting and serving static content, (javascript, css, images, etc..). Obvious examples are Amazon S3, Rackspace CloudFiles, etc...
1. Sit PHP-FPM behind nginx for a bank of persistent PHP interpreters. Access this via a Unix socket.
2. Use Memcache to cache your records.
3. Use APC to cache your PHP byte code.