OpenPKG Advent Calendar 2006

...every day a little pondering, backstage information, jokes, tips and tricks.
5
Tuesday 2006-12-05: Little Pondering
Cost Reduction I: Multiple-Instance Feature

There's a lesson to be learned from this
but I'll be damned if i know what it is."
— Al Bundy
OpenPKG's "multiple-instance" feature is one of the less understood but best features of OpenPKG as it provides a completely new flexibility in software deployment and greatly helps to reduce costs. How is this the case?

Representative Open Source Example

Let's take a medium-size Open Source software project like OpenSSL as an example. It handles about 1.1 million request-response transactions per month which is about 7GB per day and 200GB per month HTTP (website and downloads) and FTP traffic (downloads only). On average the webpage related HTTP request/response transactions are 18KB in size while the download related HTTP and FTP request/response transactions are 1.5MB in size.

For driving such a project people usually buy a typical server box like a HP DL380 G5, place it into a hosting datacenter of an ISP and install an Apache HTTP server plus a ProFTPD FTP server on top of an operating system like FreeBSD or an arbitrary GNU/Linux distribution.

The 24x7 Idle Crux

The crux is that with this approach the box would be just idling 24x7 as it is totally unchallenged as its utilization is below 1%. Why? Well, let's just do some math:

Back of the envelop calculation

On such a box a webserver like Apache requires about 350ms to handle a request for static content and 800ms to handle a request for dynamic content. On average this means it can handle about 2 requests per second with a single process. A single medium-featured Apache process is about 40MB in virtual process size but consumes just about 5MB of residential set size (RSS). As even the smallest HP DL380 G5 has at least 1GB of RAM and one can reasonably dedicate up to 60% of the available RAM for Apache, one is able to at least pre-fork about 140 Apache processes on such a box.

This allows the box to theoretically handle up to 280 requests per second. Although in practice it is just about the half (usually just about 150 requests per second as there are synchronization, socket buffer, CPU cache and other constraints), this nevertheless means that the box is able to easily handle about 13 million requests per day and about 400 million requests per month.

Ops!

Our single project requires just about 1 million requests per month!? So, wouldn't it be reasonable to place a whole dozend or more project setups onto the same single box? Yes, of course! And with OpenPKG's "multiple-instance" feature you can do this without increasing the administration complexity. And as N projects now no longer require N dedicated boxes, the total costs for server hardware, power consumption, cooling and rack space rent reduce from N to just 1.