質問するログイン新規登録

質問編集履歴

7

更に追加で試したこと(20190725追記3)

2019/07/25 08:57

投稿

haptic
haptic

スコア8

title CHANGED
File without changes
body CHANGED
@@ -157,6 +157,14 @@
157
157
  ```
158
158
 
159
159
 
160
+ ## 更に追加で試したこと(20190725 17:45時点)
161
+ 4時間毎のタイミングでサイトはタイムアウトで表示されません。
162
+ しかしエラーログにはなにも残らなくなりました。
163
+ watch_dogが反応せず、Apacheの再起動がかかりません。
164
+ サイトが表示されないタイミングでのPSコマンドでのHTTPDのスレッド数は200でしたので、マックスな気がします。
165
+ ただし、メモリの使用率が95%を超えていました。
166
+ Apacheリスタートが自動がかからないのはまずいのでmpm_eventの時代にもどしました。
167
+
160
168
  ### サーバーの環境
161
169
  |項目|内容|
162
170
  |:--|:--|

6

更に追加で試したこと(20190725追記2)

2019/07/25 08:57

投稿

haptic
haptic

スコア8

title CHANGED
File without changes
body CHANGED
@@ -121,7 +121,42 @@
121
121
 
122
122
  設定を一気に変えて様子を見るのは悪手だとわかっていますが、実害がでてしまっているので藁にもすがる思いです。
123
123
 
124
+ ## 更に追加で試したこと(20190725 14:00時点)
125
+ ・上記の11時時点で試したことを行っても約4時間毎のエラーでおちてしましました。
126
+ エラーメッセージは以下です。
127
+ スコアボードの記述はなくいきなりserver reached MaxRequestWorkers となっています。
128
+ ```
129
+ [Thu Jul 25 13:23:02.328449 2019] [jk:warn] [pid 27849] No JkLogFile defined in httpd.conf. Using default /etc/httpd/logs/mod_jk.log
130
+ [Thu Jul 25 13:23:02.328633 2019] [jk:warn] [pid 27849] No JkShmFile defined in httpd.conf. Using default /etc/httpd/logs/jk-runtime-status
131
+ [ N 2019-07-25 13:23:02.3521 27881/T1 age/Wat/WatchdogMain.cpp:1307 ]: Starting Passenger watchdog...
132
+ [ N 2019-07-25 13:23:02.3681 27884/T1 age/Cor/CoreMain.cpp:1311 ]: Starting Passenger core...
133
+ [ N 2019-07-25 13:23:02.3682 27884/T1 age/Cor/CoreMain.cpp:256 ]: Passenger core running in multi-application mode.
134
+ [ N 2019-07-25 13:23:02.3773 27884/T1 age/Cor/CoreMain.cpp:986 ]: Passenger core online, PID 27884
135
+ [Thu Jul 25 13:23:02.387400 2019] [mpm_prefork:notice] [pid 27849] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips Apache mod_fcgid/2.3.9 mod_jk/1.2.40 Phusion_Passenger/5.3.5 mod_perl/2.0.9-dev Perl/v5.16.3 configured -- resuming normal operations
136
+ [Thu Jul 25 13:23:02.387440 2019] [core:notice] [pid 27849] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
137
+ [ N 2019-07-25 13:23:05.5255 27884/T5 age/Cor/SecurityUpdateChecker.h:517 ]: Security update check: no update found (next check in 24 hours)
138
+ [Thu Jul 25 13:34:37.767338 2019] [mpm_prefork:error] [pid 27849] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
139
+ [Thu Jul 25 13:36:33.927238 2019] [mpm_prefork:notice] [pid 27849] AH00170: caught SIGWINCH, shutting down gracefully
124
140
 
141
+ [ N 2019-07-25 13:36:37.1196 27884/T8 age/Cor/CoreMain.cpp:641 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
142
+ [ N 2019-07-25 13:36:37.1196 27884/T1 age/Cor/CoreMain.cpp:1217 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
143
+ [ N 2019-07-25 13:36:37.1197 27884/Ta Ser/Server.h:903 ]: [ServerThr.2] Freed 0 spare client objects
144
+ [ N 2019-07-25 13:36:37.1197 27884/Ta Ser/Server.h:559 ]: [ServerThr.2] Shutdown finished
145
+
146
+ ```
147
+
148
+ mpm_preforkの設定を以下に変更しました。
149
+ ```
150
+ KeepAlive Off
151
+ StartServers 10
152
+ MinSpareServers 20
153
+ MaxSpareServers 80
154
+ ServerLimit 200
155
+ MaxRequestWorkers 200
156
+ MaxConnectionsPerChild 0
157
+ ```
158
+
159
+
125
160
  ### サーバーの環境
126
161
  |項目|内容|
127
162
  |:--|:--|

5

更に追加で試したこと(20190725追記)

2019/07/25 05:30

投稿

haptic
haptic

スコア8

title CHANGED
File without changes
body CHANGED
@@ -103,7 +103,25 @@
103
103
  約4時間毎に急激にApacheのスレッドが増える原因は何でしょうか。。。
104
104
  些細なヒントでもいいので皆様のご意見をお待ちしております。
105
105
 
106
+ ## 更に追加で試したこと(20190725 11:00時点)
107
+ [参考URL](https://support.plesk.com/hc/en-us/articles/213901685-Websites-periodically-are-not-available-scoreboard-is-full-not-at-MaxRequestWorkers)
108
+ ・mpm_preforkに変更
109
+ ・`/etc/logrotate.d/httpd`にあるApacheの読み込み方法を`reload`から`restart`に変更
110
+ ```
111
+ KeepAlive Off
112
+ StartServers 10
113
+ MinSpareServers 20
114
+ MaxSpareServers 60
115
+ ServerLimit 200
116
+ MaxClients 200
117
+ MaxRequestsPerChild 1000
118
+ ```
119
+ ・mpm_preforkの設定を上記にする。
120
+ (KeepAliveをOFFにしています)
106
121
 
122
+ 設定を一気に変えて様子を見るのは悪手だとわかっていますが、実害がでてしまっているので藁にもすがる思いです。
123
+
124
+
107
125
  ### サーバーの環境
108
126
  |項目|内容|
109
127
  |:--|:--|

4

誤字修正

2019/07/25 02:09

投稿

haptic
haptic

スコア8

title CHANGED
File without changes
body CHANGED
@@ -50,7 +50,7 @@
50
50
  ・error_logの確認をしたが、上記の通りでした
51
51
  ・crontabで4時間毎のcronがあるかどうか確認したが、なかった
52
52
  ・mpm_eventの設定を「MaxRequestWorkers 500」「ServerLimit 20」に変えてみたが同様のエラー
53
- ・mpm_eventをmpm_preworkに変えてみたが同様のエラーが起きた
53
+ ・mpm_eventをmpm_preforkに変えてみたが同様のエラーが起きた
54
54
  ```
55
55
  netstat -an | egrep ':80|:443' | grep ESTABLISHED | awk '{print $5}' | grep -o -E "([0-9]{1,3}[.]){3}[0-9]{1,3}" | sort -n | uniq -c | sort -nr
56
56
  ```
@@ -96,7 +96,10 @@
96
96
  ・mpm_eventの設定を「MaxRequestWorkers 1000」「ServerLimit 40」に変えてみたが同様のエラー
97
97
  落ちる直前に`ps aux | grep httpd `にて立ち上がっていた個数は44くらいありましたが、
98
98
  直前になって急激に増えました。平常時は13~17程度の間になります。
99
+ Apacheのスレッドが立ちまくってメモリ使用率が80%くらいまでなったので、
100
+ その後設定を「MaxRequestWorkers 750」「ServerLimit 30」にもどしました。
99
101
 
102
+
100
103
  約4時間毎に急激にApacheのスレッドが増える原因は何でしょうか。。。
101
104
  些細なヒントでもいいので皆様のご意見をお待ちしております。
102
105
 

3

更に追加で試したこと(20190724追記16:35)

2019/07/24 09:35

投稿

haptic
haptic

スコア8

title CHANGED
File without changes
body CHANGED
@@ -92,7 +92,15 @@
92
92
 
93
93
  何れにせよ4時間毎にApacheのスレッドが増えてしまう原因を潰さなければ根本的な解決にはならないと考えています・・・
94
94
 
95
+ ## 更に追加で試したこと(20190724 16:35時点)
96
+ ・mpm_eventの設定を「MaxRequestWorkers 1000」「ServerLimit 40」に変えてみたが同様のエラー
97
+ 落ちる直前に`ps aux | grep httpd `にて立ち上がっていた個数は44くらいありましたが、
98
+ 直前になって急激に増えました。平常時は13~17程度の間になります。
95
99
 
100
+ 約4時間毎に急激にApacheのスレッドが増える原因は何でしょうか。。。
101
+ 些細なヒントでもいいので皆様のご意見をお待ちしております。
102
+
103
+
96
104
  ### サーバーの環境
97
105
  |項目|内容|
98
106
  |:--|:--|

2

更に追加で試したこと(20190724追記2)

2019/07/24 07:45

投稿

haptic
haptic

スコア8

title CHANGED
File without changes
body CHANGED
@@ -84,6 +84,9 @@
84
84
  threaded: yes (fixed thread count)
85
85
  forked: yes (variable process count)
86
86
  ```
87
+ 上記の設定は以下のURLを参考にしています。
88
+ [https://support.plesk.com/hc/en-us/articles/214529205](https://support.plesk.com/hc/en-us/articles/214529205)
89
+
87
90
  設定を変更したあとは`systemctl restart httpd.service`にてApacheの再起動をおこなっています。
88
91
  ・20190723の16:00頃にサーバの再起動も試してみました。がダメでした。
89
92
 

1

更に追加で試したこと(20190724追記)

2019/07/24 01:35

投稿

haptic
haptic

スコア8

title CHANGED
File without changes
body CHANGED
@@ -56,6 +56,40 @@
56
56
  ```
57
57
  上記でアクセス回数を調べても30回を超えるIPはいなかった(攻撃されているとは考えにくい?)
58
58
 
59
+ ## 更に追加で試したこと(20190724時点)
60
+ ・mpm_eventの設定を「MaxRequestWorkers 750」「ServerLimit 30」に変えてみたが同様のエラー
61
+ mpm_eventの設定は/etc/httpd/conf.modules.d/01-cgi.conf に記述しています。
62
+ ```
63
+ # This configuration file loads a CGI module appropriate to the MPM
64
+ # which has been configured in 00-mpm.conf. mod_cgid should be used
65
+ # with a threaded MPM; mod_cgi with the prefork MPM.
66
+
67
+ <IfModule mpm_worker_module>
68
+ LoadModule cgid_module modules/mod_cgid.so
69
+ </IfModule>
70
+ <IfModule mpm_event_module>
71
+ LoadModule cgid_module modules/mod_cgid.so
72
+ MaxRequestWorkers 750
73
+ ServerLimit 30
74
+ </IfModule>
75
+ <IfModule mpm_prefork_module>
76
+ LoadModule cgi_module modules/mod_cgi.so
77
+ </IfModule>
78
+ ```
79
+ httpd.confには`Include conf.modules.d/*.conf`とあります。
80
+ mpmのモジュールは`LoadModule mpm_event_module modules/mod_mpm_event.so`よりmpm_eventです
81
+ 念の為`httpd -V`にて得られた結果に以下が記載されています
82
+ ```
83
+ Server MPM: event
84
+ threaded: yes (fixed thread count)
85
+ forked: yes (variable process count)
86
+ ```
87
+ 設定を変更したあとは`systemctl restart httpd.service`にてApacheの再起動をおこなっています。
88
+ ・20190723の16:00頃にサーバの再起動も試してみました。がダメでした。
89
+
90
+ 何れにせよ4時間毎にApacheのスレッドが増えてしまう原因を潰さなければ根本的な解決にはならないと考えています・・・
91
+
92
+
59
93
  ### サーバーの環境
60
94
  |項目|内容|
61
95
  |:--|:--|