カテゴリ別 2003年 | 2004年 | 2005年 | 2006年 | 2007年 | 2008年
知り合いサイト: よんだもの / 暴想 / Linuxでやる夫 / 新宿Vipper / 僕だけが幸せになればいいのに。
子プロセスも含めた apache の実際の使用メモリを求めようと、mod_perl: Performance Tuning の Calculating Real Memory Usage を元に以下のコードを実行してみたところ、
#!/usr/local/bin/perl
use strict;
use warnings;
use GTop;
my $gtop = GTop->new;
my $total_real = 0;
my $max_shared = 0;
my $script = "ps auxww | grep httpd | grep nobody | grep -v grep | awk '{print \$2}'";
my @apache_pids = split /\n/, `$script`;
for my $pid (@apache_pids) {
my $proc_mem = $gtop->proc_mem($pid);
my $size = $proc_mem->size($pid);
my $share = $proc_mem->share($pid);
$total_real += $size - $share;
$max_shared = $share if $max_shared < $share;
}
$total_real += $max_shared;
print GTop::size_string($total_real) . "\n";
搭載メモリよりも大きい値になりました。こういうものなのでしょうか。
最近のコメント:
RSS
![]()
This work is licensed under a
Creative Commons License
(note: text only. w/o web design, citations, (re)distributed softwares).
搭載メモリより容量でかく見えるのは、GTop で取得できるのが VMが見せてる値だからじゃないかな。GTop で取得できるのが、というよりユーザープロセスからはそれしか見えないんだけど。<br><br>関係ないけど $script のパイプのやつは pgrep 一行でできるよ!
やはりそうですか。となると MaxClients 限界値はスワップを使い出すプロセス数を試行錯誤で探すしかないんでしょうかね。<br><br>おお pgrep 便利ですね。こんなコマンドがあるとは知りませんでした。
mortgage subprime loans http://financehelp.hostuju.cz/subprime