PC関係のメモ
pgpool が大量にメモリを消費? (2) / [server] Pound が大量にメモリを消費する / スワップの有効利用? / [server] iptables 設定メモ / [server] Apache をインストール
pgpool が大量にメモリを消費? (2)
$ ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 26167 0.0 0.0 1724 4 ? S Dec15 0:00 pgpool root 26170 0.3 2.8 49024 7184 ? S Dec15 4:58 pgpool root 26171 0.0 1.8 13264 4808 ? S Dec15 1:04 pgpool root 27191 0.0 1.5 11440 3872 ? S Dec15 0:55 pgpool root 24147 0.3 3.2 39992 8200 ? S Dec15 3:55 pgpool
Pound が大量にメモリを消費する
pgpool だけじゃなく pound も・・・
$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 27894 2.8 1.3 178976 3456 ? R Dec10 234:38 pound
^^^^^^ 仮想メモリを約180MB使用?
pound をリスタートしてみる。ついでなので設定を追加(User, Group, Client, Server, Alive
ListenHTTP 192.168.0.2,80
User httpd Group httpd
Client 300 Server 3600 Alive 10
UrlGroup ".*\.(jpg|gif|css|js)$" BackEnd 127.0.0.1,8077,1 EndGroup
UrlGroup ".*" BackEnd 127.0.0.1,8080,1 EndGroup
で、kill してから pound コマンドで起動した結果
httpd 14332 0.0 0.5 2584 1336 pts/0 S 10:44 0:00 [pound] httpd 14333 2.9 1.7 340292 4516 pts/0 S 10:44 0:14 [pound]
仮想メモリの値は瞬間瞬間で100MB程度から500MB以上まで大きく変化する。
ちなみにテスト機では
root 21351 0.0 0.7 3028 1492 ? S Dec10 0:00 pound root 21352 3.8 0.8 10196 1684 ? S Dec10 323:51 pound
接続数に大きく左右されてる?
スワップの有効利用?
pgpool も pound もスワップ領域を有効利用してるだけ?
$ vmstat 3 procs memory swap io system cpu r b w swpd free buff cache si so bi bo in cs us sy id 2 0 0 129960 106580 40952 21792 6 10 13 8 2 0 9 3 0 0 0 0 129960 106548 40992 21796 0 0 0 447 304 602 24 5 71 0 0 0 129960 106204 41016 21804 0 0 4 155 192 410 21 2 78 0 0 0 129960 106212 41032 21808 0 0 0 172 210 299 19 3 78 0 0 0 129960 106220 41032 21812 0 0 0 99 138 156 8 1 91 0 0 0 129960 106204 41044 21828 0 0 0 159 233 427 26 3 70 0 0 0 129960 104868 41064 21820 0 0 0 148 208 281 28 2 70 0 0 0 129960 104868 41088 21840 0 0 0 236 272 426 23 4 73
- si、so (スワップイン/アウト)がほとんど無い
- 実メモリの空きは確保されてる
今のところ実害(パフォーマンスの低下等)が無いので様子を見る。
iptables 設定メモ
先日 からの続き。SSH 接続で設定。
vi /etc/iptables.sh
で、ルールを貼り付けたらコメントの日本語が化けた。コメント取ればいいけどこれから先困るので vim をインストール。
apt-get install vim
改めてルールを貼り付けて実行
# sh /etc/iptables.sh iptables v1.2.6a: invalid TCP port/service `snmp' specified Try `iptables -h' or 'iptables --help' for more information. iptables v1.2.6a: invalid UDP port/service `ftp' specified Try `iptables -h' or 'iptables --help' for more information. iptables v1.2.6a: invalid UDP port/service `ftp-data' specified Try `iptables -h' or 'iptables --help' for more information. iptables v1.2.6a: invalid TCP port/service `microsoft-ds' specified Try `iptables -h' or 'iptables --help' for more information. iptables v1.2.6a: invalid UDP port/service `microsoft-ds' specified Try `iptables -h' or 'iptables --help' for more information. iptables v1.2.6a: invalid TCP port/service `snmp' specified Try `iptables -h' or 'iptables --help' for more information.
と定義していないサービス名を使っていたので /etc/service に以下を書き加える。 (ルールのほうを番号で書き直したほうがいいな・・・後で)
snmp 161/tcp # Simple Net Mgmt Proto snmp 161/udp # Simple Net Mgmt Proto ftp-data 20/tcp ftp-data 20/udp ftp 21/tcp ftp 21/udp fsp fspd microsoft-ds 445/tcp microsoft-ds 445/udp
改めてルールを適用した。
起動時に自動でこのルールがリストアされるように設定
/etc/init.d/iptables save active
設定を有効にするために
dpkg-reconfigure iptables
で、
Enable the iptables init.d script?
に対してyesを選択
Apache をインストール
まずはソースをゲットするために wget が必要
apt-get install wget
wget で Apache のソースをゲットして configure
tar xvfz httpd-2.0.48.tar.gz cd httpd-2.0.48 ./configure \ --enable-so \ --enable-deflate \ --enable-dav_fs \ --enable-dav \ --enable-rewrite
結果
configure: error: no acceptable C compiler found in $PATH configure failed for srclib/apr
ギャフン!コンパイラが入ってない。
apt-get install gcc apt-get install make apt-get install libstdc++3 apt-get install libstdc++3-dev # mod_deflate で必要 apt-get install zlib1g-dev
ようやくコンパイルとインストール
make make install
ユーザを追加
groupadd -g 80 httpd useradd -g httpd -u 80 httpd passwd httpd
ディレクトリを用意
mkdir /var/www/ chown httpd.httpd /var/www mkdir /var/log/httpd chown httpd.httpd /var/log/httpd mkdir /var/lock/httpd chown httpd.httpd /var/lock/httpd
su - httpd mkdir /var/www/www.mylab.jp mkdir /var/www/www.mylab.jp/htdocs mkdir /var/log/httpd/www.mylab.jp mkdir /var/log/httpd/dav.mylab.jp
後で自動起動の設定する
BASIC! / OpenCVS
BASIC!
マルチバイトコードを扱う関数が用意されてない・・・Left/Right/Mid関数はバイト単位でぶった切るし・・・。にもかかわらずPrint関数の画面端の折り返しはきちんと処理してるのが怨めしい。
OpenCVS
NECの水冷サーバ(Express5800/110Ga-C)にWindows 7をインストールした
特に問題なくインストールできた。各種ドライバも正常に動いている。
サウンドカードがないので音がでないため、別途サウンドカードを購入することにする。

