- Oh My Hugo!
- This is a static blog!
Dynamic Memory Management - Proxmox VE
Dynamic Memory Management 动态内存管理 Introduction Optimized and effective memory management is a key factor in virtualization environments. KSM and Auto-Ballooning enables sophisticated and economic configurations for physical RAM utilization. 优化和有效的内存管理是虚拟环境的关键因素,KSM和Auto-Ballooning为物理内存管理提供了复杂且实用的配置。 KSM KSM (Kernel Samepage Merging) is running in the Linux kernel and scans the memory of all the virtual machines running on a single host, looking for duplication and consolidating. With KSM we’re able to improve virtual machine density by as much as 300% without impacting performance. One of the great benefits of using Linux as the hypervisor means KSM is not limited to KVM and virtual machines, but can also reduce memory pressure with normal Linux applications. ...
Create a Swap File on Linux
A swap file lets the kernel move idle pages out of RAM onto disk. It’s handy on small-memory hosts (VPS, VMs) that have no dedicated swap partition, and unlike a partition it can be resized or removed without repartitioning. Create the swap file 1 2 3 4 5 6 7 # Allocate a 1 GiB file. dd is preferred over fallocate here because # swapon rejects files with holes on some filesystems (e.g. ext4, XFS). dd if=/dev/zero of=/swapfile bs=1M count=1024 status=progress chmod 0600 /swapfile # only root may read/write the swap file mkswap /swapfile # format it as swap space swapon /swapfile # enable it immediately Make it persistent Add an entry to /etc/fstab so the swap file is mounted on every boot. The grep guard keeps this idempotent — running it twice won’t add a duplicate line. ...
My First Post
Hello world…