System Optimizations
Shanios includes extensive performance, gaming, and reliability optimizations out of the box, eliminating the need for manual tweaking. These enterprise-grade optimizations are pre-configured and active from first boot.
Memory & Storage Management
- ZRAM Compression: Automatic RAM compression using the zstd algorithm provides improved memory efficiency without requiring swap partitions.
- Optimized Swappiness: Tuned to 133 — encourages the kernel to use compressed ZRAM swap before evicting clean page cache, maintaining system responsiveness under memory pressure.
- Btrfs Maintenance: Automated filesystem maintenance runs in the background — periodic scrubbing for data integrity, balance operations, and defragmentation. Scheduled to minimize impact on system usage.
- Continuous Block-Level Deduplication:
beesdruns as a background daemon, deduplicating identical data blocks across all Btrfs subvolumes to reduce disk usage. - Optimized Page Lock Unfairness: Set to 1 to reduce lock contention and improve multi-threaded application performance, particularly for databases and high-concurrency workloads.
Gaming & Performance
Game Controller Hardware
- game-devices-udev: Comprehensive udev rules for 8BitDo, PlayStation (DualShock 3/4, DualSense, DualSense Edge), Xbox (360, One, Series), Nintendo Switch Pro, Joy-Cons, GameCube adapter, VR equipment, and more
- OpenRGB udev rules: RGB control for keyboards, mice, headsets, fans from ASUS Aura, Corsair, Razer, SteelSeries, Logitech G, MSI Mystic Light, Cooler Master, NZXT, and others
- Racing Wheel Support: Logitech (G25/G27/G29/G920/G923), Thrustmaster (T150/T300RS/T500RS), Fanatec — with full force feedback
Kernel-Level Gaming Optimizations
- Game Compatibility Kernel Parameters: Increased PID limit (65535), expanded memory map areas (2147483642), enhanced inotify limits
- Network Optimization: TCP FIN timeout reduced to 5 seconds (Valve SteamOS optimization) — prevents "address already in use" errors in multiplayer games
- CPU Scheduler Tuning: CFS bandwidth slice: 3000μs; base slice: 3ms; autogroup scheduling enabled
- MGLRU (Multi-Gen LRU): Enabled with aggressive settings for intelligent memory reclaim
- Transparent Hugepage: Set to
madvisefor selective large page usage - GameMode Integration: GameMode daemon enabled globally — auto-applies CPU governor, I/O priority, and GPU performance levels when games launch
- High-Precision Timers: HPET and RTC frequencies increased to 3072 Hz for superior timing accuracy
Process Management & Responsiveness
- Ananicy-cpp: Automatic process priority management with game-aware rules — background tasks are deprioritized when games or media are active
- systemd-oomd: System-wide OOM daemon enabled by default to prevent system freezes
- IRQBalance: Optimizes interrupt distribution across CPU cores
- Haveged: Hardware entropy daemon enabled by default, keeping
/dev/randomwell-seeded for cryptographic operations without stalling on low-entropy hardware - Increased File & Process Limits: Default limits raised to 1,048,576 for open files (NOFILE) and processes (NPROC)
- Fast Shutdown: Reduced timeout values (10s stop, 10s abort) — services that fail to stop gracefully are automatically killed
Boot & System Efficiency
- Plymouth (BGRT Theme): Smooth graphical boot experience showing manufacturer's logo
- Journal Size Limit: systemd journal capped at 128 MB across at most 2 rotated files, to prevent excessive disk usage
- Reduced Kernel Messages: Console printk level set to 3 (errors and critical messages only)
- Time Synchronization: systemd-timesyncd enabled by default for automatic NTP synchronization
- Socket Activation: Many services start on-demand — pcscd, lircd, gpsd, cups, avahi-daemon, saned
Automated Maintenance (Systemd Timers)
| Timer | Action |
|---|---|
btrfs-scrub.timer | Monthly scrubbing to detect and repair data corruption |
btrfs-balance.timer | Periodic filesystem balancing for optimal performance |
btrfs-defrag.timer | Automatic defragmentation on fragmented files |
btrfs-trim.timer | Regular TRIM operations for SSD optimisation |
beesd daemon | Continuous background block-level deduplication across all Btrfs subvolumes |
flatpak-update-system.timer | System Flatpak auto-updates every 12 hours |
flatpak-update-user.timer | Per-user Flatpak auto-updates every 12 hours |
shani-update.timer (per-user) | Checks for a new OS image every 2 hours and prompts before deploying |
All maintenance operations are scheduled during low-usage periods and use minimal system resources.
Verifying the Optimizations
Everything above is observable on a running system:
# ZRAM: compressed in-memory swap
zramctl
# Swappiness and page-lock tuning
sysctl vm.swappiness vm.page_lock_unfairness
# Maintenance timers: when they last ran and what's pending
systemctl list-timers --all | grep -E 'btrfs|flatpak|shani'
# bees deduplication status (unit is keyed by filesystem UUID)
systemctl status 'beesd@*'
# GameMode daemon
systemctl status gamemoded
# Raised limits
ulimit -n && ulimit -u
# MGLRU and hugepage settings
cat /sys/kernel/mm/lru_gen/enabled
cat /sys/kernel/mm/transparent_hugepage/enabled
Note: All these optimizations are pre-configured and active from first boot. No manual configuration, tweaking, or performance tuning required.
For the full security configuration — AppArmor, firewalld, kernel module blacklist, LSM stack, and hardening parameters — see Security Features.
See Also
- What is Shanios? — the design philosophy behind these defaults
- Btrfs Deep Dive — scrub, balance, and deduplication internals
- Gaming — controllers, GameMode, and the full gaming stack
- Power Management — battery and thermals blog guide
- Security Features — hardening that runs alongside these optimizations