OSの起動直後に
# free
---------------------------------
total used free shared buffers cached
Mem: 16603560 11066084 5537476 0 288572 8893400
-/+ buffers/cache: 1884112 14719448
Swap: 4096564 0 4096564
---------------------------------
これらの単位はKB
Apacheの子プロセスあたりの平均メモリ使用量(y)
# ps aux | grep [h]ttpd | awk 'BEGIN{x=0}{x+=$6}END{ print x/NR }'
---------------------------------
102628
---------------------------------
MySQLで使ってるメモリ量(z)
# ps aux | grep [m]ysqld | awk 'BEGIN{x=0}{x+=$6}END{ print x/NR }'
---------------------------------
97032.4
---------------------------------
Apacheの最大子プロセス数(P) = (Apacheに割り当て可能なメモリ量-MySQLで使ってるメモリ量) / (Apacheの子プロセスあたりの平均メモリ使用量
P = (x-z)/y
<IfModule prefork.c>
StartServers P×5/256
MinSpareServers P×5/256
MaxSpareServers P×10/256
ServerLimit P
MaxClients P
MaxRequestsPerChild 1000
</IfModule>
が設定する内容
参考サイト
http://www.osscons.jp/jowaki254-218/