質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

Tomcat

TomcatはApache Software Foundation (ASF)で開発されたオープンソースのWebコンテナです。

Q&A

1回答

574閲覧

Apache+Tomcat+PostgreSQL環境で毎日22時頃にシステムスローダウンする。

kei2000

総合スコア0

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

Tomcat

TomcatはApache Software Foundation (ASF)で開発されたオープンソースのWebコンテナです。

0グッド

1クリップ

投稿2022/08/09 06:43

前提

以下の環境にて毎日22:30頃に急激に処理速度が低下し、データ処理が滞留しWeb画面表示もできなくなってしまいます。
データは毎分3,000件程度受信し、データベースに書き込んでいます。
Topコマンドにて状況を確認すると、PostgresのCOMMIT状態のプロセスが600件存在しています。

発生している問題・エラーメッセージ

毎日22時30頃にデータ受信処理ができなくなる。

エラーメッセージ
sarコマンドで確認すると%i/owaitが100%になっている。
topコマンドの結果
top - 22:27:15 up 10:19, 2 users, load average: 13.13, 3.76, 2.19
Tasks: 538 total, 1 running, 537 sleeping, 0 stopped, 0 zombie
%Cpu(s): 5.7 us, 1.8 sy, 0.0 ni, 73.4 id, 18.9 wa, 0.0 hi, 0.1 si, 0.0 st
KiB Mem : 32815220 total, 496372 free, 8623436 used, 23695412 buff/cache
KiB Swap: 2097148 total, 2094336 free, 2812 used. 21938752 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32164 tomcat 20 0 21.150g 5.489g 0 S 23.9 17.5 214:27.27 //bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.C+
10563 postgres 20 0 1845008 929508 922164 S 13.0 2.8 0:01.62 postgres: XXXXsys XXXXXXXdb 127.0.0.1(35816) COMMIT
10970 postgres 20 0 1842444 23340 18128 S 1.0 0.1 0:00.14 postgres: XXXXsys XXXXXXXdb 127.0.0.1(37650) COMMIT
2480 daemon 20 0 11.976g 51536 3708 S 0.9 0.2 2:39.64 /usr/local/apache24/bin/httpd
11487 postgres 20 0 1842380 19828 15332 S 0.9 0.1 0:00.09 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39220) COMMIT
2477 daemon 20 0 11.976g 48412 3692 S 0.8 0.1 2:16.70 /usr/local/apache24/bin/httpd
2488 daemon 20 0 11.976g 42788 3676 S 0.8 0.1 1:32.64 /usr/local/apache24/bin/httpd
11521 postgres 20 0 1840824 146332 142128 S 0.8 0.4 0:00.08 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39330) COMMIT
11498 postgres 20 0 1840368 18048 15128 S 0.7 0.1 0:00.07 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39242) COMMIT
2491 daemon 20 0 11.976g 62096 3580 S 0.6 0.2 5:12.71 /usr/local/apache24/bin/httpd
11017 postgres 20 0 1841936 89652 85220 S 0.6 0.3 0:00.11 postgres: XXXXsys XXXXXXXdb 127.0.0.1(37832) COMMIT
11488 postgres 20 0 1842392 20792 16044 S 0.6 0.1 0:00.06 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39222) COMMIT
10989 postgres 20 0 1841996 20200 16172 S 0.5 0.1 0:00.10 postgres: XXXXsys XXXXXXXdb 127.0.0.1(37692) COMMIT
11037 postgres 20 0 1841976 90632 86324 S 0.5 0.3 0:00.10 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38052) COMMIT
11264 postgres 20 0 1841912 16584 12860 S 0.5 0.1 0:00.05 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38568) COMMIT
11274 postgres 20 0 1842372 65668 60652 S 0.5 0.2 0:00.05 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38588) COMMIT
11277 postgres 20 0 1840492 67044 63188 S 0.5 0.2 0:00.07 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38594) COMMIT
11366 postgres 20 0 1840924 21528 17764 S 0.5 0.1 0:00.05 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38852) COMMIT
11368 postgres 20 0 1840832 74076 70204 S 0.5 0.2 0:00.06 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38856) COMMIT
11401 postgres 20 0 1842284 13740 9676 S 0.5 0.0 0:00.06 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38922) COMMIT
11415 postgres 20 0 1841968 30064 26024 S 0.5 0.1 0:00.05 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39070) COMMIT
11430 postgres 20 0 1842372 27404 22508 S 0.5 0.1 0:00.05 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39100) COMMIT
11483 postgres 20 0 1840212 52952 49548 S 0.5 0.2 0:00.05 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39212) COMMIT
21543 root 20 0 158276 2624 1600 S 0.5 0.0 0:12.38 top
2355 postgres 20 0 1837004 70936 70460 S 0.4 0.2 0:33.14 /usr/local/pgsql/bin/postmaster -D /disk01/pgsql/data
10911 postgres 20 0 1848564 30572 20908 D 0.4 0.1 0:00.10 postgres: autovacuum worker process XXXXXXXdb
11050 postgres 20 0 1841628 24292 20596 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38078) COMMIT
11078 postgres 20 0 1841244 29152 25600 S 0.4 0.1 0:00.09 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38134) COMMIT
11137 postgres 20 0 1842460 27528 22048 S 0.4 0.1 0:00.08 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38256) COMMIT
11236 postgres 20 0 1842508 24924 19596 S 0.4 0.1 0:00.06 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38498) COMMIT
11321 postgres 20 0 1841996 21888 17728 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38730) COMMIT
11330 postgres 20 0 1842388 36908 31732 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38760) COMMIT
11332 postgres 20 0 1843528 26476 21456 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38764) COMMIT
11348 postgres 20 0 1842356 21756 16788 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38806) COMMIT
11361 postgres 20 0 1841932 23912 20044 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38842) COMMIT
11374 postgres 20 0 1842388 16992 12352 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38868) COMMIT
11378 postgres 20 0 1840860 18224 14548 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38876) COMMIT
11431 postgres 20 0 1842476 37988 33116 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39102) COMMIT
11441 postgres 20 0 1842372 21808 16860 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39122) COMMIT
11449 postgres 20 0 1842392 16996 12312 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39138) COMMIT
11490 postgres 20 0 1842376 16796 12344 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39226) COMMIT
11517 postgres 20 0 1841240 22500 19292 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39322) COMMIT
11519 postgres 20 0 1841672 17612 14128 S 0.4 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39326) COMMIT
11529 postgres 20 0 1840340 15480 12312 S 0.4 0.0 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(39346) COMMIT
27275 root 20 0 158196 2640 1660 R 0.4 0.0 0:02.57 /bin/top -b -c -d 10 -n 720
9 root 20 0 0 0 0 S 0.3 0.0 1:53.67 [rcu_sched]
2545 daemon 20 0 11.976g 52572 3692 S 0.3 0.2 3:04.22 /usr/local/apache24/bin/httpd
10820 postgres 20 0 1844012 67664 61112 S 0.3 0.2 0:00.15 postgres: XXXXsys XXXXXXXdb 127.0.0.1(36996) COMMIT
10862 postgres 20 0 1841964 65924 61600 S 0.3 0.2 0:00.10 postgres: XXXXsys XXXXXXXdb 127.0.0.1(37218) COMMIT
10871 postgres 20 0 1842452 63116 57300 S 0.3 0.2 0:00.12 postgres: XXXXsys XXXXXXXdb 127.0.0.1(37236) COMMIT
10886 postgres 20 0 1843568 104560 98848 S 0.3 0.3 0:00.14 postgres: XXXXsys XXXXXXXdb 127.0.0.1(37272) COMMIT
10904 postgres 20 0 1843436 20696 14916 S 0.3 0.1 0:00.08 postgres: XXXXsys XXXXXXXdb 127.0.0.1(37314) COMMIT
10916 postgres 20 0 1841808 18228 14528 S 0.3 0.1 0:00.06 postgres: XXXXsys XXXXXXXdb 127.0.0.1(37434) COMMIT
10963 postgres 20 0 1841808 25052 20996 S 0.3 0.1 0:00.07 postgres: XXXXsys XXXXXXXdb 127.0.0.1(37622) COMMIT
11031 postgres 20 0 1841012 32752 28680 S 0.3 0.1 0:00.08 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38040) COMMIT
11044 postgres 20 0 1841444 82832 79172 S 0.3 0.3 0:00.07 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38066) COMMIT
11053 postgres 20 0 1841936 34460 30208 S 0.3 0.1 0:00.08 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38084) COMMIT
11091 postgres 20 0 1842588 19684 14252 S 0.3 0.1 0:00.06 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38160) COMMIT
11121 postgres 20 0 1841996 16996 13084 S 0.3 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38220) COMMIT
11127 postgres 20 0 1843660 38184 32504 S 0.3 0.1 0:00.07 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38232) COMMIT
11144 postgres 20 0 1842456 54180 48504 S 0.3 0.2 0:00.08 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38278) COMMIT
11145 postgres 20 0 1841624 26680 22924 S 0.3 0.1 0:00.07 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38280) COMMIT
11172 postgres 20 0 1842448 18776 13744 S 0.3 0.1 0:00.08 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38370) COMMIT
11193 postgres 20 0 1841264 35772 32124 S 0.3 0.1 0:00.07 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38412) COMMIT
11251 postgres 20 0 1841612 30020 26384 S 0.3 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38542) COMMIT
11276 postgres 20 0 1842396 27580 22476 S 0.3 0.1 0:00.04 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38592) COMMIT
11294 postgres 20 0 1840776 17412 13868 S 0.3 0.1 0:00.03 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38638) COMMIT
11295 postgres 20 0 1842456 38220 32596 S 0.3 0.1 0:00.06 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38642) COMMIT
11319 postgres 20 0 1840724 53356 49552 S 0.3 0.2 0:00.03 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38726) COMMIT
11320 postgres 20 0 1840344 13496 10636 S 0.3 0.0 0:00.03 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38728) COMMIT
11334 postgres 20 0 1842496 23392 18468 S 0.3 0.1 0:00.03 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38770) COMMIT
11338 postgres 20 0 1840776 26068 22252 S 0.3 0.1 0:00.03 postgres: XXXXsys XXXXXXXdb 127.0.0.1(38780) COMMIT

該当の環境

OS:Centos 7.3
Web:Apache 2.2
AP:tomcat 8.0.43
DB:PostgreSQL 9.2

試したこと

Tomcat max_totalを300→500
PostgreSQL max_connection 300→500
CPU 8→16
メモリ16GB→32GB

補足情報(FW/ツールのバージョンなど)

jmeterにて負荷試験を実施しても問題発生しない。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

slemntqe

2022/08/09 06:59 編集

ログや出力を省略せずに全て書いて頂けることはとても良いことです。しかし縦に長くなってしまいますのでコード挿入用タグ(```)で囲むことによって適切に表示されます。ぜひ利用してみて下さい。
guest

回答1

0

PostgreSQLということなので、Auto Vacuumが動いている可能性はないでしょうか?

投稿2022/08/10 03:04

jcs502ulf

総合スコア307

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問