centos7 應用筆記: systemd-analyze 分析開機過程
centos7 是使用 systemd 管理服務的。
如果 開機很慢。可以使用 systemd-analyze 分析開機過程。
使用 systemd-analyze 分析開機過程
# 打印耗時的服務
systemd-analyze blame
> 20.132s boot.mount
> 19.963s kdump.service # <- time consuming
> 11.355s lvm2-monitor.service
> 9.906s systemd-udev-settle.service
> 7.303s NetworkManager-wait-online.service # <- time consuming
> 6.759s dev-mapper-centos\x2droot.device
> 4.795s postfix.service
> 4.308s tuned.service
> 3.024s lvm2-pvscan@8:5.service
> 2.247s vdo.service
# 圖形輸出到 issue.svg
# 更直觀的分析開機過程
systemd-analyze plot > issue.svg
# 使用圖片查看器 打開圖形文件 issue.svg
eog issue.svg
關閉不必要的服務
# 關閉 kdump.service。
systemctl disable kdump.service
# 關閉 NetworkManager-wait-online.service。
systemctl disable NetworkManager-wait-online.service