Swap in Ceph Node

yena

Renowned Member
Nov 18, 2011
378
5
83
Hello, i have a Ceph node with this ram allocation:

root@nodo3:~# free
total used free shared buffers cached
Mem: 65939008 65211332 727676 2584660 724684 54518756
-/+ buffers/cache: 9967892 55971116
Swap: 3801084 3801072 12

----------------------------------------------------------------

On the node i have 4 VPS, for a total Ram assignement of 22G Ram.

The Os is on a DOM, and the Swap is only 3G.
The node seem OK... but i'm worried about the Swap allocation (full).
Is the full swap a real problem ?
I'm thinkng about add an extra SSD only for SWAP... is it a good idea ?

Thanks
 
Os is on a DOM, and the Swap is only 3G.
The node seem OK... but i'm worried about the Swap allocation (full).
Is the full swap a real problem ?
I'm thinkng about add an extra SSD only for SWAP... is it a good idea ?

Thanks


Hello again,

Swap is like a safety belt for cases when memory is not sufficient. A simple stupid rule for me is like this:

swap (minim)= memory of the server
swap (for proxmox)= memory of the server + total-number-of-guests x 1÷4 GB

I think is more usefull to add more memory instead to add a new SSD.
 
Hello again,

Swap is like a safety belt for cases when memory is not sufficient. A simple stupid rule for me is like this:

swap (minim)= memory of the server
swap (for proxmox)= memory of the server + total-number-of-guests x 1÷4 GB

I think is more usefull to add more memory instead to add a new SSD.

Thanks Dude,
Could you tell me How many Ram have i to reserve for Ceph Host Node ? ( now i have 64G RAM tot )
 
Hi,
the most part of your ram is used for caching (to speed up read-IO).

Normaly you don't want to use swap (you can modify swapiness to reduce the swap uses) but i have seen the effect too, that also with swapiness=1 much swapspace is used.

Nevertheless I would not use as much swap as ram - this is done yoears ago with 4GB ram...
imho 16GB should be enough.

Udo
 
Nevertheless I would not use as much swap as ram - this is done yoears ago with 4GB ram...
imho 16GB should be enough.

If you do not need so much swap, yes it is ok. But if it is bigger... what you can loose? If it is smaller... maybe in a day... you will regret because you could setup few Gb more some month ago. So if you can imagine like Nostradamus, what you will run in the next 6 month, use a smaller swap size ;)

And maybe in a morning, you will find.... that you have 99.9% disk space...! În a such case you can use your swap as let say /some-folder, and you get some valuable time to solve the problem.

But anybody can use what is better for his own case.
 
Last edited:
Hi Udo,

If you are out of memory, the clients will see this, with or without swap. The problem is not how bigger swap do you have (you can optimeze the swapiness for your use case), because if your swapp is smaller , you will have a lot of swap--in/out. Is better to be able to move bigger quantity of ram to/from swap.
Anyway, you need to find the optimum size for your test case. Also it is possible to use some kind of compression type of swap like zram for example.
 

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!