KSM sharing not working

ultrex

New Member
Mar 7, 2011
28
0
1
Hello,

I download .iso and install (today), but KSM sharing not working
CPU: 2x L5520

root@t90:~# pveversion -v
proxmox-ve-2.6.32: 3.1-114 (running kernel: 2.6.32-26-pve)
pve-manager: 3.1-21 (running version: 3.1-21/93bf03d4)
pve-kernel-2.6.32-26-pve: 2.6.32-114
lvm2: 2.02.98-pve4
clvm: 2.02.98-pve4
corosync-pve: 1.4.5-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.0-2
pve-cluster: 3.0-8
qemu-server: 3.1-8
pve-firmware: 1.0-23
libpve-common-perl: 3.0-8
libpve-access-control: 3.0-7
libpve-storage-perl: 3.0-17
pve-libspice-server1: 0.12.4-2
vncterm: 1.1-4
vzctl: 4.0-1pve4
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 1.4-17
ksm-control-daemon: 1.1-1
glusterfs-client: 3.4.1-1

i try restart service
root@t90:~# /etc/init.d/ksmtuned restart
Stopping KSM control daemon: ksmtuned.
Starting KSM control daemon: ksmtuned.
root@t90:~# cat /sys/kernel/mm/ksm/pages_sharing
0

root@t90:~# free -m
total used free shared buffers cached
Mem: 36193 20743 15450 0 1060 362
-/+ buffers/cache: 19319 16874
Swap: 35839 0 35839
root@t90:~#



Please help :)
 
Last edited:
KSM Sharing works best when you have similar OS installed in multiple VMs. If all your VMs are completely different, you wont see much happening there. How many VMs do you have installed? What are the nature of OSes? If you only have 1 VM installed for testing purpose, KSM will not come into effect.

Use this command to see KSM working at all or not:
watch cat /sys/kernel/mm/ksm/pages_sharing
 
I install 15x win xp to old server (cpu intel i7-870) and with scp command send virtual disk (with scp command) to this server with L5520

i7-870 ksm sharing is working
L5520 (new proxmox) ksm sharing not working

Every 2.0s: cat /sys/kernel/mm/ksm/pages_sharing Fri Dec 20 20:59:20 2013

0


Maybe BIOS configuration wrong?
 
I install 15x win xp to old server (cpu intel i7-870) and with scp command send virtual disk (with scp command) to this server with L5520

i7-870 ksm sharing is working
L5520 (new proxmox) ksm sharing not working

Every 2.0s: cat /sys/kernel/mm/ksm/pages_sharing Fri Dec 20 20:59:20 2013

0


Maybe BIOS configuration wrong?

KSM works out of the box. There is no configuration/enable on a fresh installed Proxmox. Do you see anything suspicious in Syslog? Do not think BIOS has anything to do with KSM. KSM is an OS feature which balances memory blocks.
Are all VMs turned on and functioning properly? Sometimes VMs shows powered on but not actually running inside.

Sent from my ASUS Transformer Pad TF700T using Tapatalk
 
root@t90:~# cat /var/log/syslog |grep -i ksm
root@t90:~#
0 record about ksm


root@t90:~# qm list |grep run
6007 winxpX6007 running 1024 0.00 3485
6008 winxpX6008 running 1024 0.00 3527
6009 winxpX6009 running 1024 0.00 3557
6010 winxpX6010 running 1024 0.00 3587
6011 winxpX6011 running 1024 0.00 3620
6012 winxpX6012 running 1024 0.00 3662
6013 winxpX6013 running 1024 0.00 3687
6014 winxpX6014 running 1024 0.00 3711
6015 winxpX6015 running 1024 0.00 3735
6016 winxpX6016 running 1024 0.00 3762
6017 winxpX6017 running 1024 0.00 3786
6018 winxpX6018 running 1024 0.00 3810
6019 winxpX6019 running 1024 0.00 3835
6020 winxpX6020 running 1024 0.00 3859

Speedtest from winxp
1: http://www.speedtest.net/my-result/3178233790
2: http://www.speedtest.net/my-result/3178232885

win xp is working.

Proxmox is /dev/sda, winxp - /dev/sdc


config:

args: -vnc 0.0.0.0:1115
bootdisk: ide0
cores: 1
ide0: vps:6015/vm-6001-disk-1.raw,format=raw
memory: 1024
name: winxpX6015
net0: virtio=5E:22:9D:D5:10:70,bridge=vmbr0
ostype: win7
sockets: 1
 
Are all the VMs got fixed memory of 1GB? Any difference if you choose variable memory between 512MB to 1GB in each VM?

Sent from my ASUS Transformer Pad TF700T using Tapatalk
 
Hi, ksm begin to scan pages when host memory reach 80%.
can be tuned in /etc/ksmtuned.conf


# KSM_THRES_COEF: Decimal percentage of free RAM
# If free memory is less than this percentage KSM will be activated
# KSM_THRES_COEF=20
 
I change. Now config:
root@t90:~# cat /etc/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=50
# KSM_THRES_CONST=2048

# uncomment the following if you want ksmtuned debug info

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

and restart ksmtuned
root@t90:~# /etc/init.d/ksmtuned restart
Stopping KSM control daemon: ksmtuned.
Starting KSM control daemon: ksmtuned.


everything ok ?
 
Beaware of the fact that ksm is eating up CPU so depends what resource is more important to you.. ram or cpu..
 
Even I tried to reached 80% memory. Still not working. Pages shared/sharing is always 0. How did you know it's working?

just check that ksmtuned service is running
systemctl status ksmtuned.service

then, after reaching 80% memory usage, you should see a process "[ksmd]" take a little bit cpu.
it can take some minutes before ksm have finished to scan memory, and put pages as shared.
 

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!