OFFSET偏移
← All articlesOFFSET / FIELD NOTESNO. 060

Performance choices and an everyday maintenance checklist

Use measurements to choose kernels, compressed swap, and power management, and establish checks after rolling updates.

English translation · Code and commands follow the Chinese original.

IN THESE READING PATHSArch Linux ↗
About 3 min readStart reading

Kernels, compressed swap, and memory pressure#

linux-zen

linux-zen is a kernel option focused on the desktop experience. Test its benefits with actual workloads; its name does not tell you which scheduler it uses at any given time or guarantee smoother performance.

sudo pacman -S linux-zen linux-zen-headers

Keep a tested fallback kernel, and check boot entries and DKMS module support for each kernel.

zram-generator

zram compresses swap pages in memory, which can help relieve memory pressure. It still consumes CPU and RAM and cannot provide persistent storage or a hibernation target.

sudo pacman -S zram-generator

Example /etc/systemd/zram-generator.conf:

[zram0]
zram-size = min(ram / 2, 8192)
compression-algorithm = zstd

Adjust the size and algorithm for your workload. After the generated configuration takes effect, check it with zramctl and swapon --show. Keep separate disk-backed swap if hibernation is needed.

Experiment in /etc/sysctl.d/99-zram.conf:

vm.swappiness=180

A higher swappiness can make compressed swap more actively used, but monitor latency, compression ratios, and CPU overhead. Not every system needs 180.

systemd-oomd

sudo systemctl enable --now systemd-oomd.service

oomd chooses what to terminate using pressure information such as PSI and policies on managed cgroups; it does not merely look for “processes with memory leaks.” Check desktop session integration and ManagedOOM* policies. Selected applications may lose unsaved work.

Weekly maintenance#

  • Read Arch News before updating, then complete sudo pacman -Syu.
  • After updating the kernel or important libraries, restart the affected processes and reboot the system if necessary.
  • paccache -r keeps the latest 3 cached versions by default. To keep 2, use sudo paccache -rk2. You can inspect and enable paccache.timer.
  • Use systemctl --failed to check for failed services, then inspect their logs.

Monthly maintenance#

Merging configuration

Use pacdiff or a diff tool to review .pacnew and .pacsave files. Merge new defaults with the configuration this machine requires; do not simply overwrite the original files.

Orphaned packages

pacman -Qdt

First check which packages are still needed, and adjust installation reasons if necessary. When removing packages, explicitly select those you have confirmed are no longer needed:

sudo pacman -Rns <CONFIRMED_ORPHAN_PACKAGE>

-n prevents pacman-managed configuration from being saved as .pacsave; it does not delete all configuration in home directories. Avoid passing unchecked query results directly to a removal command.

Log storage

sudo journalctl --vacuum-size=100M

This deletes archived journal files until the space limit is met; active logs may not be included in this cleanup. If logs must be retained for incident investigation, export the relevant records first, then configure long-term retention according to your capacity policy.

Choosing power management#

GNOME’s power-profiles-daemon and TLP provide different policies. Choose one primary manager and check for conflicts; do not disable the entire desktop power or session component.

Example TLP setup:

sudo pacman -S tlp
sudo systemctl enable --now tlp.service

Decide whether to switch to TLP based on tests of power consumption, hibernation, and hardware support, rather than treating one tool as the default choice for every laptop.

Troubleshooting performance problems in order#

top
systemctl --failed
journalctl -p 3 -xb
sudo dmesg -W

Identify CPU, memory, storage, or device errors before changing parameters. Record response time, power consumption, or load before and after testing. Avoid changing the kernel, swap, and power management at the same time, which makes it hard to identify the cause.

How updates relate to recovery#

graph TD
    Prepare[读新闻并检查恢复入口] --> Update[完成 pacman -Syu]
    Update --> Config[审阅 pacnew 并检查服务]
    Config --> Verify[重启后验证内核与关键应用]
    Verify --> Maintain[按需清理缓存日志和孤儿包]

References & further reading

  1. ArchWiki: System maintenance ↗
  2. ArchWiki: Zram ↗
  3. ArchWiki: Systemd/oomd ↗
  4. ArchWiki: Power management ↗
  5. paccache(8) ↗

Adapted from technical notes. Examples use generic names.

Continue along a reading path

Arch Linux

  1. 01Arch Linux philosophy and installation planning
  2. 02Kernel management, systemd-boot, and UKIs
  3. 03Pacman hooks, the AUR, and build security
  4. 04Btrfs subvolume layouts and Snapper snapshots
  5. 05Hardening with LUKS2, Secure Boot, and TPM2
  6. 06Performance choices and an everyday maintenance checklist
  7. 07Common Pacman commands and how to remember their flags
  8. 08Diagnosing slow Pacman downloads and choosing mirrors
  9. 09informant: Arch news and Pacman hooks
  10. 10Arch Linux with Btrfs: manual installation and archinstall
  11. 11Configuring GNOME, input methods, and snapshots
  12. 12GNOME laptop management and desktop customization
  13. 13KVM, GPU passthrough, and gaming on Arch Linux
  14. 14Swap, kernels, and troubleshooting on an Arch desktop
CONTINUE READING / NEXT ARTICLECommon Pacman commands and how to remember their flags

Use the S, Q, R, and U operation groups to distinguish repository queries, local queries, removal, and local package installation.