# Solve common flakiness with SSH (MTU discovery on flaky links). net.ipv4.tcp_mtu_probing=1 # Tune reclaim for swap on zram, which is orders of magnitude faster than the # disk swapfile these defaults assume. # Anything above 100 tells the kernel that evicting an anonymous page is # cheaper than dropping a page-cache page it would have to re-read from disk. # With a compressed RAM device that is true, so the disk-era default of 60 # leaves the page cache starved. vm.swappiness=180 # Read one page per swap-in fault. The default of 8 pays for a seek that zram # doesn't have, and every extra page costs a separate decompression. vm.page-cluster=0 # Don't let external fragmentation raise the watermarks, which produces # reclaim bursts while memory is still free. vm.watermark_boost_factor=0 # Keep ~1.25% of memory free instead of 0.1%, so kswapd reclaims in the # background rather than letting allocations stall in direct reclaim. vm.watermark_scale_factor=125