質問編集履歴

7

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

2019/07/25 08:57

投稿

haptic
haptic

スコア8

test CHANGED
File without changes
test CHANGED
@@ -316,6 +316,22 @@
316
316
 
317
317
 
318
318
 
319
+ ## 更に追加で試したこと(20190725 17:45時点)
320
+
321
+ 4時間毎のタイミングでサイトはタイムアウトで表示されません。
322
+
323
+ しかしエラーログにはなにも残らなくなりました。
324
+
325
+ watch_dogが反応せず、Apacheの再起動がかかりません。
326
+
327
+ サイトが表示されないタイミングでのPSコマンドでのHTTPDのスレッド数は200でしたので、マックスな気がします。
328
+
329
+ ただし、メモリの使用率が95%を超えていました。
330
+
331
+ Apacheリスタートが自動がかからないのはまずいのでmpm_eventの時代にもどしました。
332
+
333
+
334
+
319
335
  ### サーバーの環境
320
336
 
321
337
  |項目|内容|

6

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

2019/07/25 08:57

投稿

haptic
haptic

スコア8

test CHANGED
File without changes
test CHANGED
@@ -244,6 +244,76 @@
244
244
 
245
245
 
246
246
 
247
+ ## 更に追加で試したこと(20190725 14:00時点)
248
+
249
+ ・上記の11時時点で試したことを行っても約4時間毎のエラーでおちてしましました。
250
+
251
+ エラーメッセージは以下です。
252
+
253
+ スコアボードの記述はなくいきなりserver reached MaxRequestWorkers となっています。
254
+
255
+ ```
256
+
257
+ [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
258
+
259
+ [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
260
+
261
+ [ N 2019-07-25 13:23:02.3521 27881/T1 age/Wat/WatchdogMain.cpp:1307 ]: Starting Passenger watchdog...
262
+
263
+ [ N 2019-07-25 13:23:02.3681 27884/T1 age/Cor/CoreMain.cpp:1311 ]: Starting Passenger core...
264
+
265
+ [ N 2019-07-25 13:23:02.3682 27884/T1 age/Cor/CoreMain.cpp:256 ]: Passenger core running in multi-application mode.
266
+
267
+ [ N 2019-07-25 13:23:02.3773 27884/T1 age/Cor/CoreMain.cpp:986 ]: Passenger core online, PID 27884
268
+
269
+ [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
270
+
271
+ [Thu Jul 25 13:23:02.387440 2019] [core:notice] [pid 27849] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
272
+
273
+ [ 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)
274
+
275
+ [Thu Jul 25 13:34:37.767338 2019] [mpm_prefork:error] [pid 27849] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
276
+
277
+ [Thu Jul 25 13:36:33.927238 2019] [mpm_prefork:notice] [pid 27849] AH00170: caught SIGWINCH, shutting down gracefully
278
+
279
+
280
+
281
+ [ 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)
282
+
283
+ [ 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...
284
+
285
+ [ N 2019-07-25 13:36:37.1197 27884/Ta Ser/Server.h:903 ]: [ServerThr.2] Freed 0 spare client objects
286
+
287
+ [ N 2019-07-25 13:36:37.1197 27884/Ta Ser/Server.h:559 ]: [ServerThr.2] Shutdown finished
288
+
289
+
290
+
291
+ ```
292
+
293
+
294
+
295
+ mpm_preforkの設定を以下に変更しました。
296
+
297
+ ```
298
+
299
+ KeepAlive Off
300
+
301
+ StartServers 10
302
+
303
+ MinSpareServers 20
304
+
305
+ MaxSpareServers 80
306
+
307
+ ServerLimit 200
308
+
309
+ MaxRequestWorkers 200
310
+
311
+ MaxConnectionsPerChild 0
312
+
313
+ ```
314
+
315
+
316
+
247
317
 
248
318
 
249
319
  ### サーバーの環境

5

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

2019/07/25 05:30

投稿

haptic
haptic

スコア8

test CHANGED
File without changes
test CHANGED
@@ -208,6 +208,42 @@
208
208
 
209
209
 
210
210
 
211
+ ## 更に追加で試したこと(20190725 11:00時点)
212
+
213
+ [参考URL](https://support.plesk.com/hc/en-us/articles/213901685-Websites-periodically-are-not-available-scoreboard-is-full-not-at-MaxRequestWorkers)
214
+
215
+ ・mpm_preforkに変更
216
+
217
+ ・`/etc/logrotate.d/httpd`にあるApacheの読み込み方法を`reload`から`restart`に変更
218
+
219
+ ```
220
+
221
+ KeepAlive Off
222
+
223
+ StartServers 10
224
+
225
+ MinSpareServers 20
226
+
227
+ MaxSpareServers 60
228
+
229
+ ServerLimit 200
230
+
231
+ MaxClients 200
232
+
233
+ MaxRequestsPerChild 1000
234
+
235
+ ```
236
+
237
+ ・mpm_preforkの設定を上記にする。
238
+
239
+ (KeepAliveをOFFにしています)
240
+
241
+
242
+
243
+ 設定を一気に変えて様子を見るのは悪手だとわかっていますが、実害がでてしまっているので藁にもすがる思いです。
244
+
245
+
246
+
211
247
 
212
248
 
213
249
  ### サーバーの環境

4

誤字修正

2019/07/25 02:09

投稿

haptic
haptic

スコア8

test CHANGED
File without changes
test CHANGED
@@ -102,7 +102,7 @@
102
102
 
103
103
  ・mpm_eventの設定を「MaxRequestWorkers 500」「ServerLimit 20」に変えてみたが同様のエラー
104
104
 
105
- ・mpm_eventをmpm_preworkに変えてみたが同様のエラーが起きた
105
+ ・mpm_eventをmpm_preforkに変えてみたが同様のエラーが起きた
106
106
 
107
107
  ```
108
108
 
@@ -194,6 +194,12 @@
194
194
 
195
195
  直前になって急激に増えました。平常時は13~17程度の間になります。
196
196
 
197
+ Apacheのスレッドが立ちまくってメモリ使用率が80%くらいまでなったので、
198
+
199
+ その後設定を「MaxRequestWorkers 750」「ServerLimit 30」にもどしました。
200
+
201
+
202
+
197
203
 
198
204
 
199
205
  約4時間毎に急激にApacheのスレッドが増える原因は何でしょうか。。。

3

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

2019/07/24 09:35

投稿

haptic
haptic

スコア8

test CHANGED
File without changes
test CHANGED
@@ -186,6 +186,22 @@
186
186
 
187
187
 
188
188
 
189
+ ## 更に追加で試したこと(20190724 16:35時点)
190
+
191
+ ・mpm_eventの設定を「MaxRequestWorkers 1000」「ServerLimit 40」に変えてみたが同様のエラー
192
+
193
+ 落ちる直前に`ps aux | grep httpd `にて立ち上がっていた個数は44くらいありましたが、
194
+
195
+ 直前になって急激に増えました。平常時は13~17程度の間になります。
196
+
197
+
198
+
199
+ 約4時間毎に急激にApacheのスレッドが増える原因は何でしょうか。。。
200
+
201
+ 些細なヒントでもいいので皆様のご意見をお待ちしております。
202
+
203
+
204
+
189
205
 
190
206
 
191
207
  ### サーバーの環境

2

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

2019/07/24 07:45

投稿

haptic
haptic

スコア8

test CHANGED
File without changes
test CHANGED
@@ -170,6 +170,12 @@
170
170
 
171
171
  ```
172
172
 
173
+ 上記の設定は以下のURLを参考にしています。
174
+
175
+ [https://support.plesk.com/hc/en-us/articles/214529205](https://support.plesk.com/hc/en-us/articles/214529205)
176
+
177
+
178
+
173
179
  設定を変更したあとは`systemctl restart httpd.service`にてApacheの再起動をおこなっています。
174
180
 
175
181
  ・20190723の16:00頃にサーバの再起動も試してみました。がダメでした。

1

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

2019/07/24 01:35

投稿

haptic
haptic

スコア8

test CHANGED
File without changes
test CHANGED
@@ -114,6 +114,74 @@
114
114
 
115
115
 
116
116
 
117
+ ## 更に追加で試したこと(20190724時点)
118
+
119
+ ・mpm_eventの設定を「MaxRequestWorkers 750」「ServerLimit 30」に変えてみたが同様のエラー
120
+
121
+ mpm_eventの設定は/etc/httpd/conf.modules.d/01-cgi.conf に記述しています。
122
+
123
+ ```
124
+
125
+ # This configuration file loads a CGI module appropriate to the MPM
126
+
127
+ # which has been configured in 00-mpm.conf. mod_cgid should be used
128
+
129
+ # with a threaded MPM; mod_cgi with the prefork MPM.
130
+
131
+
132
+
133
+ <IfModule mpm_worker_module>
134
+
135
+ LoadModule cgid_module modules/mod_cgid.so
136
+
137
+ </IfModule>
138
+
139
+ <IfModule mpm_event_module>
140
+
141
+ LoadModule cgid_module modules/mod_cgid.so
142
+
143
+ MaxRequestWorkers 750
144
+
145
+ ServerLimit 30
146
+
147
+ </IfModule>
148
+
149
+ <IfModule mpm_prefork_module>
150
+
151
+ LoadModule cgi_module modules/mod_cgi.so
152
+
153
+ </IfModule>
154
+
155
+ ```
156
+
157
+ httpd.confには`Include conf.modules.d/*.conf`とあります。
158
+
159
+ mpmのモジュールは`LoadModule mpm_event_module modules/mod_mpm_event.so`よりmpm_eventです
160
+
161
+ 念の為`httpd -V`にて得られた結果に以下が記載されています
162
+
163
+ ```
164
+
165
+ Server MPM: event
166
+
167
+ threaded: yes (fixed thread count)
168
+
169
+ forked: yes (variable process count)
170
+
171
+ ```
172
+
173
+ 設定を変更したあとは`systemctl restart httpd.service`にてApacheの再起動をおこなっています。
174
+
175
+ ・20190723の16:00頃にサーバの再起動も試してみました。がダメでした。
176
+
177
+
178
+
179
+ 何れにせよ4時間毎にApacheのスレッドが増えてしまう原因を潰さなければ根本的な解決にはならないと考えています・・・
180
+
181
+
182
+
183
+
184
+
117
185
  ### サーバーの環境
118
186
 
119
187
  |項目|内容|