Okay, if that's the case then maybe we can get down to specifically
what
they do to manage intense workloads.
In my web 2.0 presentation ask the following question: "Which is a more
closely guarded secret, Google's search algorithm, or their system's
management process?" Then I point out that you can download the original
search thesis, and they've patented large portions of their current
search technology, but it's nearly impossible to find out about how they
manage their systems. Same is true of facebook, twitter, etc. The
ability to manage and control 1000s of servers is what gives these
companies their competitive advantage. I do know, for example, that
facebook runs about 1000 memcached servers in their caching tier, each
w/32G of memory, so that's a 32 terra-byte memory cache!
But say we set ThreadsPerChild to 20, even though we anticipate 1,000
unique
visitors within a few minutes of opening the application to the
Internet.
That would be a bottleneck. On the other hand, if we were to set it to
1,000,
that could lead to the HTTP server launching about 500 pre-fork
instances
of PHP. That would be resource contention (memory & CPU).
This is performance tuning, nothing more. It's just like setting max-act
in a memory pool on the i. To low and you don't optimize your hardware,
too large and you spend all your time thrashing.
Assume you're right about 1000 visitors in, say 5 minutes. How many
pages each in those 5 minutes? 10? OK, so 10,000 page-views across 5
minutes, or 2,000 per minute. If a page takes 10 ms to run on the
server, then a single process can handle 100 pages per second, or 6,000
per minute, so you could theoretically handle that load with one
process. However, add in the nature of queuing and the fact that they're
not perfectly spaced and you'll need maybe 5 processed to handle that
workload. Of course this assumes 10ms on a page load, and that PHP is
only involved in the HTML part, not serving the images, js, css, etc.
But then again, the load testing you did would tell you exactly what you
could handle. :-)
-Walden
As an Amazon Associate we earn from qualifying purchases.