Archlinux 启动优化

这篇日志是对Improve_Boot_Performance 的改进。

  1. 内核参数优化 

修改/boot/grub/grub.cfg  添加

libahci.ignore_sss=1 #禁用sss
raid=noautodetect 
ipv6.disable=1 #禁用ipv6
nomodeset #不使用kms,
plymouth.enable=0  #禁用plymouth
rootfstype=ext4 #root分区类型
selinux=0#禁用selinux
完成后:
linux   /vmlinuz-linux root=UUID=abed89cb-4fef-4166-93c8-907b20709807 ro libahci.ignore_sss=1 
raid=noautodetect ipv6.disable=1 nomodeset plymouth.enable=0 rootfstype=ext4 selinux=0 quiet

你也可以写入/etc/default/grub 中

GRUB_CMDLINE_LINUX="libahci.ignore_sss=1 raid=noautodetect ipv6.disable=1 nomodeset plymouth.enable=0 rootfstype=ext4 selinux=0"

 执行 grub-mkconfig -o /boot/grub/grub.cfg 重新生成grub.cfg文件。

  • 优化fstab

/dev/sda3   /var        ext4        rw,relatime    0 1
挂载磁盘参数有如下几种时间属性:

ctime:change time

mtime:modify time

atime:access time,影响磁盘性能,每次访问文件都会更新记录。

relatime:为了解决atime的一些问题而引入。

mtime和ctime的区别在于,只有修改了文件的内容,才会更新文件的mtime,而对文件更名,修改文件的属主等操作,只会更新ctime。

只有当mtime比atime更新的时候,才会更新atime。

  • 系统服务优化

尽量减少系统服务的启动数量。

使用systemctl disable 不用的服务,保留必要的服务。

systemctl disable mysqld.service
#禁用蓝牙服务
systemctl disable bluetooth.service
#禁用ipv6 iptables
systemctl disable ip6tables.service
#禁用打印服务
systemctl disable cups.service

 

使用systemctl mask  不再加载服务单元。

systemctl mask remote-fs.target

systemctl mask sys-kernel-config.mount

systemctl mask sys-kernel-debug.mount

 网络参数优化

wip

内存使用策略优化

wip

转载于:https://my.oschina.net/osgit/blog/102557

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值