Some notes on tuning a server for MKDoc.
mod_perl
See the Performance Tuning document from the mod_perl 1.0 User Guide.
If you install the GTop module and add this code (based on the Calculating Real Memory Usage code) to the end of mkdoc.cgi (before 1;):
use GTop; my $proc_mem = GTop->new->proc_mem($$); my $diff = $proc_mem->size - $proc_mem->share; $diff = $diff/1024; $diff = $diff/1024; my $size = $proc_mem->size; $size = $size/1024; $size = $size/1024; my $share = $proc_mem->share; $share = $share/1024; $share = $share/1024; print STDERR "Difference is $diff MB, Size is $size MB and Share is $share MB\n";
Then you will get lines like this written to the error log:
Difference is 40.4765625 MB, Size is 45.234375 MB and Share is 4.7578125 MB Difference is 40.73828125 MB, Size is 45.49609375 MB and Share is 4.7578125 MB Difference is 42.01171875 MB, Size is 46.76953125 MB and Share is 4.7578125 MB Difference is 40.9453125 MB, Size is 45.6875 MB and Share is 4.7421875 MB Difference is 41.69921875 MB, Size is 46.44140625 MB and Share is 4.7421875 MB
This basically means that each Apache process uses around 40MB of RAM and in addition there is about 5MB of shared RAM.
. Total RAM Dedicated to the Webserver MaxClients = ------------------------------------ MAX child's process size
So for example if you have 256M dedicated to Apache:
. 256M MaxClients = ------ = 6.4 40M