[SOLVED] KSM Sharing testing

mspencerl87

New Member
Aug 14, 2023
2
0
1
Hello, all. I started reading about KSM Sharing. I noticed that this should start working when 80% or so.
The majority of my CTs, and VMs are Ubuntu Based. So should all be sharing same base image.

Proxmox01 I (Not in screenshot) I spun up another VM on Ubuntu and got the memory utilization up to 90% and noticed KSM doesn't appear to do anything.
Proxmox02 I spun up 3 identical machines, with 18GB each, and loaded up the memory to use about 58GB total. KSM also did not appear to work.

Any Ideas?
Does Ballooning memory need to be used for this feature in the Linux Kernel to work?
Or am I missing something obvious.

Lol, do I just need to uncomment these lines for this to work?
KSM_THRES_COEF=20
KSM_THRES_CONST=2048

ksmtuned.conf
# Configuration file for ksmtuned.

# How long ksmtuned should sleep between tuning adjustments
# KSM_MONITOR_INTERVAL=60

# Millisecond sleep between ksm scans for 16Gb server.
# Smaller servers sleep more, bigger sleep less.
# KSM_SLEEP_MSEC=100

# KSM_NPAGES_BOOST=300
# KSM_NPAGES_DECAY=-50
# KSM_NPAGES_MIN=64
# KSM_NPAGES_MAX=1250

# KSM_THRES_COEF=20
# KSM_THRES_CONST=2048

# uncomment the following if you want ksmtuned debug info

# LOGFILE=/var/log/ksmtuned
# DEBUG=1
 

Attachments

  • systemctl.png
    systemctl.png
    34.4 KB · Views: 20
  • KMS Test02.png
    KMS Test02.png
    125.1 KB · Views: 20
  • KMS Test.png
    KMS Test.png
    108.1 KB · Views: 19
Last edited:
KSM will start working if the memory if full enough. 80% with the default COEFF=20. You can uncomment and set it higher in the config file. For example, set the COEFF to 50, as it will then start at 50% memory usage. A restart of the ksmtuned.service is necessary to apply the changes.

systemctl restart ksmtuned.service
 
  • Like
Reactions: mspencerl87
I Uncommented
KSM_MONITOR_INTERVAL=60
KSM_THRES_COEF=50 and restarted ksmtuned

already seeing
KSM sharing
2.39 MiB


Been using this install since 7.4, first time I've got this to work! Thanks

Should any other variables be edited?
# Configuration file for ksmtuned.

# How long ksmtuned should sleep between tuning adjustments
KSM_MONITOR_INTERVAL=60

# Millisecond sleep between ksm scans for 16Gb server.
# Smaller servers sleep more, bigger sleep less.
# KSM_SLEEP_MSEC=100

# KSM_NPAGES_BOOST=300
# KSM_NPAGES_DECAY=-50
# KSM_NPAGES_MIN=64
# KSM_NPAGES_MAX=1250

KSM_THRES_COEF=50
# KSM_THRES_CONST=2048

# uncomment the following if you want ksmtuned debug info

# LOGFILE=/var/log/ksmtuned
# DEBUG=1

Thanks!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!