Difference between revisions of "Improve boot performance (简体中文)"

From ArchWiki
Jump to: navigation, search
(自己编译内核: Move in from systemd)
(避免重复挂载: Move in from Systemd.)
Line 49: Line 49:
== 精简输出信息 ==
修改启动加载器内核参数中的 {{ic|verbose}} 为 {{ic|quiet}} 即可。对于某些用户,特别是 SSD 用户,TTY 的龟速实际上成为了性能瓶颈,精简输出信息实际上有利于提高性能。
== 参阅 ==
== 参阅 ==

Revision as of 05:00, 24 November 2012

Summary help replacing me
Arch Boot Process (简体中文)
Udev (简体中文)
Daemon (简体中文)
Maximizing Performance
翻译状态: 本文是英文页面 Improve_Boot_Performance翻译,最后翻译时间:2012-11-04,点击这里可以查看翻译后英文页面的改动。



systemd-analyze命令可以显示启动时各个部分的时间,包括一个 svg 图表,显示 units 等待它们依赖所花费的时间。详情参阅man systemd-analyze


自己编译内核、关闭不需要的功能,恐怕是加速系统启动的最有效方法了。 更多信息参见:Kernel_Compilation_From_Source

Early start for services

One central feature of systemd is D-Bus and socket activation. This causes services to be started when they are first accessed and is generally a good thing. However, if you know that a service (like UPower) will always be started during boot, then the overall boot time might be reduced by starting it as early as possible. This can be achieved (if the service file is set up for it, which in most cases it is) by issuing:

# systemctl enable upower

This will cause systemd to start UPower as soon as possible, without causing races with the socket or D-Bus activation.

Staggered spin-up

有些硬件使用staggered spin-up,操作系统一个一个访问硬盘,以减少耗电。这会降低启动速度,大部分用户都不需要开启。检查是否开启:

$ dmesg | grep SSS

如果没有查到,表示未启动。如果有显示,可以将libahci.ignore_sss=1 加入 kernel line 进行禁用。


mkinitcpio提供了 fsck 钩子,将启动加载配置中的 root 从 ro 修改为 rw 并删除 /etc/fstab 中的 root 挂载,可以避免重复挂载。挂载参数可以通过rootflags=[mount options...]设置。

删除 /etc/fstab 中的 API 文件系统,systemd 会自动挂载它们。下面命令可以获得这些 API 文件系统的列表:

$ pacman -Ql systemd | grep '\.mount$'



修改启动加载器内核参数中的 verbosequiet 即可。对于某些用户,特别是 SSD 用户,TTY 的龟速实际上成为了性能瓶颈,精简输出信息实际上有利于提高性能。