NYCPHP Meetup

NYPHP.org

[nycphp-talk] advice on scaling up

Marc Antony Vose suzerain at suzerain.com
Tue Jul 10 13:47:13 EDT 2007


Hi all:

I'm a developer who has concentrated more on smaller-scale projects,  
but as it turns out one of my projects is beginning to stress the  
limits of a single server, and so I'm about to begin venturing into  
the unknown.

The project is currently in the "tens of thousands" of users range,  
but it looks like we need to start drafting a plan to scale it up to  
"hundreds of thousands" to a million or so users.

This is a site that is running on a custom built PHP framework (which  
seems to be performing rather well), and MySQL.  The server's running  
Apache and Linux (Red Hat). There is some image and data uploading  
from users, and most pages are served dynamically, currently, with  
very simple SQL.  I have taken the step of caching any page elements  
that require any kind of recursion or iteration to produce (such as a  
list of categories that displays the number of related items from  
other tables in it), but I have not cached, for example, database  
calls to just one item matching on the primary key.  I think this  
approach has been sensible so far.

If I had to classify the site, I'd say it follows a similar usage  
pattern as something like last.fm, or facebook, only much smaller.   
Social networking-type thing, but users are not constantly visiting  
and reloading pages, like a news site.

So, more than the PHP coding strategy, my question is about what kind  
of hosting/server arrangement I would be looking at to handle the  
kind of load I'm talking about.

How many servers will I need to handle the kind of traffic I  
require?  If this question is not so easily answered, then what would  
be my equation for figuring this out?  A friend told me he works on a  
site that has 4,000,000 users and they have their system optimized to  
handle 500 requests per second.  This is for a search engine-type  
site...is this a reasonable metric?

When you separate database and http servers, then what should be the  
hardware priorities for each?  CPU speed? RAM?  hard disk speed,  
etc.?  Perhaps the database is more RAM and HD dependent, and the web  
server will need more CPU and RAM?

I'd be interesting in learning a bit from those of you who are  
working on larger-scale projects what's powering your servers, and  
what kind of capacity you think your setup's giving you.

Thanks for helping me determine exactly where to research.

Cheers,

Marc Vose
Suzerain Studios



More information about the talk mailing list