Before you start to optimize server configuration and learn to write a
more efficient code you need to consider the demands which will be
placed on the Hardware and the Operating System. There is no point in
investing a lot of time and money in configuration tuning and code
optimizing only to find that your server’s performance is poor because
you did not choose a suitable platform in the first place.
Because hardware platforms and operating systems are developing
rapidly (even while you are reading this article), the following
advisory discussion must be in general terms, without mentioning
specific vendors names.
Choosing the Right Operating System
I will try to talk about what characteristics and features you should
be looking for to support a mod_perl enabled Apache server, then when
you know what you want from your OS, you can go out and find it.
Visit the Web sites of the operating systems you are interested in.
You can gauge user’s opinions by searching the relevant discussions in
newsgroup and mailing list archives. Deja – http://deja.com and
eGroups – http://egroups.com are good examples. I will leave this fan
research to you. But probably the best shot will be to ask mod_perl
users, they know the best.
Stability and Robustness Requirements
Probably the most important features in an OS are stability and
robustness. You are in an Internet business. You do not keep normal
9am to 5pm working hours like many conventional businesses you know.
You are open 24 hours a day. You cannot afford to be off-line, for
your customers will go shop at another service like yours (unless you
have a monopoly :). If the OS of your choice crashes every day, first
do a little investigation. There might be a simple reason which you
can find and fix. There are OSs which won’t work unless you reboot
them twice a day. You don’t want to use the OS of this kind, no
matter how good the OS’ vendor sales department. Do not follow flashy
advertisements, follow developers’ advice instead.
Generally, people who have used the OS for some time can tell you a
lot about its stability. Ask them. Try to find people who are doing
similar things to what you are planning to do, they may even be using
the same software. There are often compatibility issues to resolve.
You may need to become familiar with patching and compiling your OS.
Good Memory Management Importance
You want an OS with a good memory management implementations. Some OSs
are well known as memory hogs. The same code can use twice as much
memory on one OS compared to another. If the size of the mod_perl
process is 10Mb and you have tens of these running, it definitely adds
Say No to Memory Leaks
Some OSs and/or their libraries (e.g. C runtime libraries) suffer from
memory leaks. A leak is when some process requests a chunk of memory
for temporary storage, but then does not subsequently release it. The
chunk of memory is not then available for any purpose until the
process which requested it dies. You cannot afford such leaks. A
single mod_perl process sometimes serves thousands of requests before
it terminates. So if a leak occurs on every request, the memory
demands could become huge. Of course your code can be the cause of
the memory leaks as well, but it’s easy to detect and solve.
Certainly, we can reduce the number of requests to be served over the
process’ life, but that can degrade performance.