Apache 的进程数量不断增长

Apache 的进程数量不断增长

我的 apache2 运行在 debian stretch 服务器之上,经常会出现不稳定性,导致 apache 的进程数量不断增加,如下图所示:

Apache 处理 munin 图

当进程数达到允许的最大进程数时,apache 服务器就会达到饱和点并停止响应。

Apache 由 varnish 缓存辅助,而 https 握手由 pound 完成。

该服务器托管一个 mediawiki 站点;众所周知,mediawiki 非常耗资源,但 mediawiki 配置为使用 memcached 服务器,而不仅仅是 varnish。无论如何,这个站点的流量相当低。

另一个网站托管,访问量很大,但其代码相当优化。

我的问题是:为什么 apache 的进程数开始增长?可能是什么原因?是否有我可以更改的 apache 参数?任何帮助都值得感激。

更新:

apache 的服务器状态显示如下内容:

Current Time: Thursday, 22-Nov-2018 22:11:32 CET
Restart Time: Thursday, 22-Nov-2018 17:01:50 CET
Parent Server Config. Generation: 6
Parent Server MPM Generation: 5
Server uptime: 5 hours 9 minutes 42 seconds
Server load: 1.56 1.62 1.60
Total accesses: 290978 - Total Traffic: 13.0 GB
CPU Usage: u3035.84 s853.12 cu95.02 cs23.17 - 21.6% CPU load
15.7 requests/sec - 0.7 MB/second - 46.8 kB/request
211 requests currently being processed, 29 idle workers

WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWW_WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW_WWWWWWWWW
WWWWWWWWWWWWW_WWWWWWWWWWWWWWWWW_WWWWWWK_WW_WWWWWWWWWW__WW_WWWWWW
_WWWW_WWWW__WWWW__WWWWWKWW_W__WW_WW_W____W_K____................
Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process

Srv     PID         Acc         M   CPU      SS    Req    Conn  Child   Slot    Client  Protocol    VHost   Request
0-5     7078    39/1894/7033    W   51.62   2474    0   1212.2  76.84   291.35  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=35212&anchor=documento_7&rito
1-5     7079    26/1754/6210    W   46.84   2617    0   325.6   69.37   232.28  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=19354&anchor=documento_6&rito
2-5     6992    45/2272/7227    W   65.72   2063    0   967.3   135.68  323.88  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=46711&anchor=documento_8&rito
3-5     7115    34/1956/6752    W   51.85   2276    0   550.6   75.82   255.04  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=19354&anchor=documento_6&rito
4-5     7116    13/2177/7569    W   55.30   1474    0   95.5    97.34   363.31  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=46711&anchor=documento_8&rito
5-5     24741   38/38/2319      W   0.81    2303    0   470.6   0.46    78.81   localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=46711&anchor=documento_8&rito
6-5     7164    8/1820/3582     W   55.88   2273    0   2053.8  88.03   152.63  localhost   http/1.1    www.myserver.net:8080   GET /indice.php?id=95&includisottoaree=1&parole=dieci+comandame
7-5     6991    41/2284/4871    W   61.35   2411    0   1672.6  101.89  225.53  localhost   http/1.1    www.myserver.net:8080   GET /indice.php?id=151&area=video&includisottoaree=1&parole=die
8-5     7177    13/1905/5509    W   54.31   2513    0   110.7   65.53   242.78  localhost   http/1.1    www.myserver.net:8080   GET /indice.php?id=95&includisottoaree=1&parole=dieci+comandame
9-5     7178    19/1685/3773    W   57.13   2311    0   230.0   85.37   198.94  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=46711&anchor=documento_8&rito
10-5    6993    10/1730/6138    W   58.98   2153    0   279.8   77.14   269.71  localhost   http/1.1    www.myserver.net:8080   GET /indice.php?id=95&includisottoaree=1&parole=dieci+comandame
11-5    7203    24/1800/7684    W   64.24   2497    0   410.8   94.65   378.47  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=19354&anchor=documento_6&rito
12-5    24767   25/322/4734 W   8.75    1703    0   949.1   8.59    193.58  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=46711&anchor=documento_8&rito
13-5    7274    26/2444/4303    W   62.34   1077    0   265.0   84.95   165.15  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=19354&anchor=documento_6&rito
14-5    6994    27/1825/3191    W   51.14   2257    0   200.5   116.68  183.87  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=19354&anchor=documento_6&rito
15-5    7275    11/1920/5549    W   47.93   2234    0   229.7   81.32   239.53  127.0.0.1   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=35212&anchor=documento_7&rito
16-5    7296    38/1966/5571    W   54.47   2516    0   872.8   80.50   309.33  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=19354&anchor=documento_6&rito
17-5    24768   12/28/1781  W   0.36    2249    0   135.1   0.22    67.21   localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=35212&anchor=documento_7&rito
18-5    7351    10/2297/5512    W   75.49   1529    0   74.7    120.55  275.52  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=35212&anchor=documento_7&rito
19-5    7352    13/2282/3062    W   65.76   2157    0   347.7   86.21   125.06  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=19354&anchor=documento_6&rito
20-5    7381    23/2084/2791    W   57.86   2017    0   1473.5  180.55  242.64  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=19354&anchor=documento_6&rito
21-5    7382    6/2094/4607 W   55.89   2571    0   33.0    78.08   188.96  127.0.0.1   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=46711&anchor=documento_8&rito
22-5    7407    24/2039/4816    W   54.73   2393    0   518.9   81.25   208.01  localhost   http/1.1    www.myserver.net:8080   GET /indice.php?id=95&includisottoaree=1&parole=dieci+comandame
23-5    6990    6/1881/3829 W   52.14   2369    0   80.3    85.97   185.38  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=35212&anchor=documento_7&rito
24-5    7408    41/2789/4877    W   81.54   1050    0   1052.5  139.01  231.51  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=35212&anchor=documento_7&rito
25-5    7441    45/2442/4354    W   82.24   1014    0   4094.1  123.39  238.31  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=46711&anchor=documento_8&rito
26-5    7442    9/1853/3907 W   40.79   2489    0   117.7   66.26   166.42  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=35212&anchor=documento_7&rito
27-5    23874   4/1412/3792 W   34.98   2551    0   557.1   58.33   164.30  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=46711&anchor=documento_8&rito
28-5    23926   3/1636/4245 W   49.36   2594    0   31.9    125.24  236.27  127.0.0.1   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=35212&anchor=documento_7&rito
29-5    23927   47/2030/3795    W   58.84   1437    0   1151.4  95.04   168.33  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=19354&anchor=documento_6&rito
30-5    7477    33/2402/4309    W   62.78   2423    0   5086.6  146.04  252.14  localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=46711&anchor=documento_8&rito
31-5    24786   26/36/1660  W   1.07    2129    0   819.7   0.84    94.21   localhost   http/1.1    www.myserver.net:8080   GET /materiale/anteprima.php?file=35212&anchor=documento_7&rito
etc...

为什么大多数孩子过了很长时间才发回复?

SS值高是不是意味着保留子服务器而不重复使用也不杀死它们?KeepAliveTimeout是5秒....

相关内容