[svlug] What is the smallest, fastest web server to run PHP and SSL (on a soekris box)
scott at doubleu.com
Wed Oct 18 17:56:06 PDT 2006
On 10/18/06, Daevid Vincent <daevid at daevid.com> wrote:
> I need to run a httpd server that can serve up PHP, SQL Lite, and SSL on a
> little Soekris box (ie. a 486 with 64MB RAM and 32MB CF storage).
> Can anyone recommend something?
If you're using a net4801-50, upgrade to net4801-60 (256M rather than
128M). But since you say 64M, are you on a net45x1 of some sort?
> How small can Apache get?
Pretty small. My unoptimized one from a RedHat 7.2 box is around 8M,
but only 5M resident. From an FC3 box, running mod_perl, I'm seeing
20M-40M process sizes, but I've spent _zero_ time optimizing my
mod_perl on that box.
A "small" Apache process size might be around 4M. Remember that
Apache uses shared memory, so you shouldn't just sum up the process
> Related, does anyone know of a tutorial or something that will help to
> reduce Apache to only the things really needed for PHP, mySQL, SSL? Right
> now, our Apache memory footprint is an astounding 120MB !!
Just get started? You'll be building your own httpd, so just build
with no add-ins, and add stuff in that you need. There is no "right"
I think the big problem, here, is PHP. You don't need mysql in
Apache, unless PHP does. SSL you do, but shouldn't be a hideous
memory hog. From the above, I assume you're considering use of sqlite
instead of mysql? That would probably provide twofold savings
(reduced client-side footprint plus no need to run the mysql server).
One thing you might consider would be using Apache 1.3.37 rather than
a 2.x release. Keeping it small will probably be easier (though using
a multithreaded mpm under 2.x might be easier, too :-). Another thing
to consider would be to push your PHP usage to a separate server via
fastcgi, or even into a straight-up cgi rather than loading it into
Apache. It really depends on what your performance needs are (cgi
will be slower, but since you're running on a Soekris box, you might
not mind that so much).
In general, the big problem with in-Apache modules in the prefork
world is post-fork initialization. So you want to push as much
initialization as possible into the prefork side of things, so that it
can be shared across all processes. This is probably less of a
problem in a threaded server.
More information about the svlug