[pgpool-general-jp: 1061] pgpool-ii 3.0.2でコネクション枯渇

甲斐寛大 kai.t @ opst.co.jp
2012年 5月 23日 (水) 22:37:35 JST


はじめまして。
甲斐と申します。

pgpool-II 3.0.2を利用しております。
クライアントからのアクセス数が増加する時間帯になると、
瞬間的にpgpoolが無応答?になる現象が発生しています。

●環境(ざっくりで申し訳ございませんが)
CentOS 5.7 (64bit)
pgpool-ii 3.0.2
 num_init_children = 400 (こちらを150や200にしても同様の事象が発生します)
 max_pool = 1

PostgreSQL 8.4.5
DBは3台で、うち2台にのみ参照を負荷分散してます


ログは以下のようなものです。
==================================
2012-05-22 11:15:32 ERROR: pid 8087: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11095: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 12241: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 12241: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 8087: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11095: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11095: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 8087: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 12241: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11347: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11095: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 12241: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11095: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 12241: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 8087: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11347: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 12241: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11095: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 8087: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11347: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 12241: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11095: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 11347: pool_read: read failed
(Connection reset by peer)
2012-05-22 11:15:32 ERROR: pid 8087: pool_read: read failed
(Connection reset by peer)
==================================

このログ出力後、一時的にpgpoolの待ち受けプロセスが最大にまで達し、
pgpool: wait for connection request
のプロセスがなくなってしまいました(待受可能なコネクションが枯渇)

なお、DBではスロークエリ3秒以上を取得しているのですが、
スロークエリ発生との関連性はログからは見受けられません。
→ロックやデッドロックの可能性は低いと考えています。

ちなみにvmstatをかけていたのですが、こちらを見ると時々待ちプロセス数が異常に増えることが
あります(関連性は不明ですが・・・)。

procs -----------memory---------- ---swap-- -----io---- --system--
-----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 29167720 205244 549492    0    0     0     0 32894 65303
2  4 94  0  0
 1  0      0 29164800 205244 549492    0    0     0     0 29769 71653
2  4 94  0  0
 2  0      0 29165792 205244 549492    0    0     0   176 33032 72669
2  5 93  0  0
 1  0      0 29166040 205244 549492    0    0     0     0 34578 69403
2  5 93  0  0
★360  0      0 29166164 205244 549492    0    0     0     0 36821 78877  3  6 92
 0  0
 0  0      0 29166288 205244 549492    0    0     0     0 32292 74371
2  5 92  0  0
 0  0      0 29164436 205244 549492    0    0     0     0 31968 67757
2  5 93  0  0
 0  0      0 29165444 205244 549492    0    0     0     0 32297 68306
2  5 93  0  0
 2  0      0 29165816 205244 549492    0    0     0   144 31552 63346
2  5 93  0  0
 0  0      0 29165640 205244 549492    0    0     0     0 28965 64347
2  4 94  0  0
★365  0      0 29165248 205244 549492    0    0     0     0 28749 63463  2  4 94
 0  0
 0  0      0 29162816 205244 549492    0    0     0     0 29575 63985
2  3 95  0  0
 0  0      0 29163188 205244 549492    0    0     0     0 30538 69439
2  4 94  0  0
 1  0      0 29163188 205244 549492    0    0     0   136 32626 70010
2  4 94  0  0
 1  0      0 29162532 205244 549492    0    0     0     0 34895 66734
3  5 92  0  0
★269  0      0 29162792 205244 549492    0    0     0     0 28747 68402  2  5 93
 0  0
 1  0      0 29161456 205244 549492    0    0     0     0 36903 77513
3  5 92  0  0
 1  0      0 29161456 205244 549492    0    0     0     0 34989 73500
2  4 93  0  0
 0  0      0 29162048 205244 549492    0    0     0   144 36276 74358
3  5 93  0  0
 0  0      0 29162496 205244 549492    0    0     0                 0
20816 51602        1  3 96  0  0
 0  0      0 29162356 205244 549492    0    0     0     8 22872 53626
2  3 95  0  0
 3  0      0 29162964 205244 549492    0    0     0     0 34201 71034
3  4 93  0  0
 1  0      0 29163932 205244 549492    0    0     0     0 30189 63848
2  4 94  0  0
 0  0      0 29164680 205244 549492    0    0     0   148 33918 66229
2  5 93  0  0

CPUは24コアで、使用率等は9%程度です。

同様の事象について、お心当たりございませんでしょうか。


pgpool-general-jp メーリングリストの案内