lnmp1.5包安装的 lnmpa环境架构 出现CPU 占用过高的情况 求帮助
本帖最后由 Sandy 于 2019-5-24 10:58 编辑使用的是lnmp1.5安装包,安装的环境是lnmpa php5.6 MariaDB10.2 Jemalloc apache2.4.33
服务器 12核 8G 10M
同时网络并发最高20
服务器启动72小时后
top指令查看 12核CPU 基本全部核心都是 100% 占用
有多个httpd进程
服务器明显出现卡顿问题
重起apache CPU恢复 一段时间 (超72小时) 后 CPU 又被全部占满
服务器有多个WEB 站点 部分开启了https
有高手指点下 怎么优化吗???
这个不好确定原因
建议strace追踪占cpu较高的pid看看 top - 16:16:52 up 2 days, 23:05,2 users,load average: 45.34, 45.31, 44.88
Tasks: 168 total, 2 running, 166 sleeping, 0 stopped, 0 zombie
%Cpu0: 80.3 us,0.4 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 19.2 st
%Cpu1: 79.2 us,0.8 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 19.9 st
%Cpu2: 82.4 us,0.8 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 16.8 st
%Cpu3: 62.9 us,0.0 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 37.1 st
%Cpu4: 74.4 us,1.7 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 23.9 st
%Cpu5: 71.2 us,0.0 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 28.8 st
%Cpu6: 71.2 us,0.0 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 28.8 st
%Cpu7: 66.5 us,0.0 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 33.5 st
%Cpu8: 78.7 us,0.4 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 20.9 st
%Cpu9: 70.0 us,0.4 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 29.6 st
%Cpu10 : 70.2 us,1.4 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 28.4 st
%Cpu11 : 55.9 us,0.0 sy,0.0 ni,0.0 id,0.0 wa,0.0 hi,0.0 si, 44.1 st
KiB Mem :8008696 total,3853028 free,2645468 used,1510200 buff/cache
KiB Swap: 0 total, 0 free, 0 used.4988840 avail Mem
PID USER PRNI VIRT RES SHR S%CPU %MEM TIME+ COMMAND
4335 www 20 0 2393364 205292 9136 S 235.32.6 4160:24 httpd
3419 www 20 0 2307952 198064 6664 S 204.32.5 3677:41 httpd
3418 www 20 0 2307452 221412 7048 S 132.32.8 2889:28 httpd
6903 www 20 0 2391152 209232 9560 S 129.02.6 2328:42 httpd
3417 www 20 0 2393396 218380 9576 S99.72.7 975:16.02 httpd
6746 www 20 0 2306428 209004 6012 S59.72.6 942:03.34 httpd
6847 www 20 0 2300220 173104 5960 S50.22.2 706:28.76 httpd
6901 www 20 0 2302116 220056 6012 S19.52.7 349:41.55 httpd
3378 mariadb 20 0 7583260 39190812368 S 0.74.916:29.16 mysqld
9 root 20 0 0 0 0 R 0.30.0 4:46.89 rcu_sched
1972 root 20 0157736 2304 1564 S 0.30.014:15.31 top
3157 www 20 0 8914036780 2432 S 0.30.5 0:17.90 nginx
3162 www 20 0 8914036808 2400 S 0.30.5 0:19.60 nginx
5545 root 20 0157716 2304 1548 R 0.30.0 6:14.14 top
1 root 20 0191412 4432 2504 S 0.00.1 0:15.79 systemd
2 root 20 0 0 0 0 S 0.00.0 0:00.01 kthreadd
3 root 20 0 0 0 0 S 0.00.0 0:02.52 ksoftirqd/0
5 root 0 -20 0 0 0 S 0.00.0 0:00.00 kworker/0:0H
7 root rt 0 0 0 0 S 0.00.0 0:00.30 migration/0
8 root 20 0 0 0 0 S 0.00.0 0:00.00 rcu_bh
10 root rt 0 0 0 0 S 0.00.0 0:01.69 watchdog/0
11 root rt 0 0 0 0 S 0.00.0 0:05.73 watchdog/1
12 root rt 0 0 0 0 S 0.00.0 0:00.26 migration/1
13 root 20 0 0 0 0 S 0.00.0 0:02.59 ksoftirqd/1
16 root rt 0 0 0 0 S 0.00.0 0:05.88 watchdog/2
17 root rt 0 0 0 0 S 0.00.0 0:00.33 migration/2
18 root 20 0 0 0 0 S 0.00.0 0:02.35 ksoftirqd/2
20 root 0 -20 0 0 0 S 0.00.0 0:00.00 kworker/2:0H
21 root rt 0 0 0 0 S 0.00.0 0:05.74 watchdog/3
22 root rt 0 0 0 0 S 0.00.0 0:00.37 migration/3
23 root 20 0 0 0 0 S 0.00.0 0:02.71 ksoftirqd/3
24 root 20 0 0 0 0 S 0.00.0 0:00.00 kworker/3:0
25 root 0 -20 0 0 0 S 0.00.0 0:00.00 kworker/3:0H
26 root rt 0 0 0 0 S 0.00.0 0:05.95 watchdog/4
27 root rt 0 0 0 0 S 0.00.0 0:00.37 migration/4
28 root 20 0 0 0 0 S 0.00.0 0:02.56 ksoftirqd/4
29 root 20 0 0 0 0 S 0.00.0 0:01.66 kworker/4:0
30 root 0 -20 0 0 0 S 0.00.0 0:00.00 kworker/4:0H
31 root rt 0 0 0 0 S 0.00.0 0:05.85 watchdog/5 :'( 没有大神指点下的吗???? LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
#LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
LoadModule unixd_module modules/mod_unixd.so
#LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule info_module modules/mod_info.so
#LoadModule cgid_module modules/mod_cgid.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
#LoadModule actions_module modules/mod_actions.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
https.conf 启用了LoadModule mpm_event_module modules/mod_mpm_event.so
发现配置里面好像 缺少 mpm_event_module的配置信息找了资料添加配置信息如下 不知道能不能解决这个问题
<IfModule mpm_event_module>
StartServers 3
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxRequestWorkers 400
MaxConnectionsPerChild 0
</IfModule>
果然没有用,就没有愿意指点下的大神吗?哎。。。。
页:
[1]