用systemd-analyze分析Linux系统的启动性能 |
本文标签:Linux,启动 systemd-analyze是一个分析启动性能的工具,用于分析启动时服务时间消耗 。默认显示启动是内核和用户空间的消耗时间: 复制代码 代码如下: [root@localhost']#systemd-analyze
Startupfinishedin818ms(kernel)+6.240s(initrd)+32.979s(userspace)=40.038s 和使用systemd-analyzetime命令的效果一样 。
复制代码 代码如下:[root@localhost']#systemd-analyzeblame 30.852siscsi.service 16.994skdump.service 10.871sboot.mount ... 103mssystemd-sysctl.service 101msdatapool.mount (2)查看严重消耗时间的服务树状表
复制代码 代码如下:[root@localhost']#systemd-analyzecritical-chain Thetimeaftertheunitisactiveorstartedisprintedafterthe"@"character. Thetimetheunittakestostartisprintedafterthe"+"character. multi-user.target@32.976s └─kdump.service@15.981s+16.994s └─network.target@15.980s └─NetworkManager.service@15.069s+54ms └─firewalld.service@14.532s+535ms └─basic.target@14.532s └─sockets.target@14.532s └─dbus.socket@14.532s └─sysinit.target@14.527s └─systemd-update-utmp.service@14.524s+2ms └─systemd-tmpfiles-setup.service@14.456s+67ms └─local-fs.target@14.447s └─boot.mount@3.575s+10.871s └─systemd-fsck@dev-disk-by\x2duuid-8c77568b\x2d7e51\x2d4e32\x2dbbdf\x2ddc12ff737bbf.service@3.348s+226ms └─systemd-fsck-root.service@1.237s+152ms └─systemd-readahead-replay.service@1.073s+25ms (3)打印分析图及其他命令
复制代码 代码如下:[root@localhost']#systemd-analyzeplot>plot.svg ![]() 其他参数: |