PVE4.4 : How to increase swap on Host

flotho

Renowned Member
Sep 3, 2012
49
3
73
Hi everyone,

I'm trying to make many LXc runn together and each of thoses CT has at least 2Go of SWAP
Yet during the install, the host has been set up with only 4Go of RAM and of course, many OOM killed the process that are put in SWAP CT.
I would like to increase the size of the SWAP dynamically. I know tht it is supposed to be easy, I found those ressources :
* http://www.jamescoyle.net/how-to/622-proxmox-openvz-swap-and-performance => Failed on the swapon
* https://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/#comment-81591 this one failed with holes in the file
* fallocate failed while following this https://www.jamescoyle.net/how-to/1994-script-to-create-a-swapfile-on-linux

I tried with /dev/zero of /dev/random or /dev/urandom and also tried with small files and it still failing.

here is my conf :
Code:
4.4-92 (running kernel: 4.4.62-1-pve)
pve-manager: 4.4-13 (running version: 4.4-13/7ea56165)
pve-kernel-4.4.44-1-pve: 4.4.44-84
pve-kernel-4.4.67-1-pve: 4.4.67-92
pve-kernel-4.4.49-1-pve: 4.4.49-86
pve-kernel-4.4.62-1-pve: 4.4.62-88
lvm2: 2.02.116-pve3
corosync-pve: 2.4.2-2~pve4+1
libqb0: 1.0.1-1
pve-cluster: 4.0-52
qemu-server: 4.0-110
pve-firmware: 1.1-11
libpve-common-perl: 4.0-95
libpve-access-control: 4.0-23
libpve-storage-perl: 4.0-76
pve-libspice-server1: 0.12.8-2
vncterm: 1.3-2
pve-docs: 4.4-4
pve-qemu-kvm: 2.7.1-4
pve-container: 1.0-100
pve-firewall: 2.0-33
pve-ha-manager: 1.0-41
ksm-control-daemon: 1.2-1
glusterfs-client: 3.5.2-2+deb8u3
lxc-pve: 2.0.7-4
lxcfs: 2.0.6-pve1
criu: 1.6.0-1
novnc-pve: 0.5-9
smartmontools: 6.5+svn4324-1~pve80

Here is also the result of my swap conf:
Code:
# swapon -s
Filename                                Type            Size    Used    Priority
/dev/zd0                                partition       4194300 3551364 -1

My question is how to increase the swap?

Any help would be appreciated.

regards
 
Hi,

do you like to only extent your swap or do you have a separate swap device?
 
Please show output of 'df -h' command and tell how much swap do you want at this point?
 

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!