Memory Optimisation and RAM Savings with KSM
Review KSM memory deduplication, its CPU cost and what to measure with your own Proxmox workload.
How does KSM affect memory usage?
Kernel Samepage Merging is a Linux kernel feature that merges pages with identical content in eligible memory areas. When it is necessary to write to a shared page, a separate copy is created for the process that needs to write. Scanning work also has resource costs; therefore, memory savings and processor load should be evaluated together.
No single savings percentage applies to every infrastructure. The number of virtual machines, their applications and changes in memory content affect the result. Using similar operating system templates does not in itself prove a certain amount of savings. Do not use a target such as “40 percent savings” as a given in a product guarantee or capacity planning.
Measurement plan for your own workload
First record the current status: memory used on the node, available capacity, processor load and application response times. Keep the number of virtual machines and the workload of services as similar as possible when comparing. Changing the KSM setting at the same time as a major distribution change makes it difficult to tell which change caused the result.
- Choose a representative node. Create a test group that represents the applications your customers actually use.
- Record the before and after. Compare memory and processor data from the same time period, rather than a screenshot.
- Check the service experience. If reducing memory usage increases application latency, do not judge the change a success on savings alone.
- Plan the rollback. Record which nodes and services the change affects; do not add more virtual machines without re-evaluating the capacity.
When should you re-evaluate?
Do not rely on an old measurement when operating system templates, application types, or node capacity change. Don't expect the same setting to give the same result on a different workload. Specifying the versions used, date range and number of services compared in the test note makes subsequent evaluation easier.
When creating new services with VMRobot, plan the resource package and the Proxmox host on which it will be located. Automation does not eliminate the need to measure capacity. Review licences by host count on the pricing page and the service lifecycle in the WHMCS or WISECP integration guide.
Technical resource: Refer to the Linux Kernel KSM documentation for kernel behavior and measurement fields. The checklist here is an operational plan; it does not represent measured savings in your infrastructure.