Zero's Blog - 2022年7月
https://l2dy.sourceforge.io/2022/07/
-
DigitalOcean Rocky Linux 8 默认镜像释放内存
https://l2dy.sourceforge.io/2022/07/01/digitalocean-rocky-low-mem.html
2022-07-01T17:14:00+00:00
DigitalOcean 新推出了一款只有 512 MB 内存的 droplet,然而跑个 dnf upgrade 都能触发 Out of memory: Killed process 10365 (semodule)。用 ps avxf 可以查看进程的内存占用(RSS)。在搜索资料后我发现以下服务可以优化掉,不过要避免 out of memory 还是建议配置 swap,或者换个包管理器更轻量的发行版,例如 Debian。droplet-agent即 The DigitalOcean Droplet Agent,可通过 systemctl 关闭,或用 dnf 完全卸载。dnf remove droplet-agentsssd参考 https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_authentication_and_authorization_in_rhel/index 使用以下命令可切换到最小化认证并关闭 sssd 服务。authselect select minimal
systemctl stop sssd.service
systemctl disable sssd.servicetuned参考 https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/monitoring_and_managing_system_status_and_performance/getting-started-with-tuned_monitoring-and-managing-system-status-and-performance 修改 /etc/tuned/tuned-main.conf 配置即可。daemon = 0gssproxy不需要 Kerberos 的话直接卸载也不会有什么问题。 https://github.com/gssapi/gssproxy/blob/main/docs/README.mddnf remove gssproxydnf-makecachednf 缓存会定期自动更新,为了保证稳定的内存占用需要禁用掉 dnf-makecache.timer.systemctl stop dnf-makecache.timer
systemctl disable dnf-makecache.timer最终效果# free -h
total used free shared buff/cache available
Mem: 460Mi 103Mi 227Mi 6.0Mi 130Mi 339Mi
Swap: 0B 0B 0B