retechpro

Well-Known Member
Dec 23, 2022
141
16
18
Pakistan
cPanel Access Level
Root Administrator
Hi All,
my swap memory is reached to 99%.
Swap Size is 4gb which has been reached.

my server specs is 16 core with 128gb ram.
Currently half of the Ram is free.

Is it good to increase the swap memory? Or i can refresh the existing memory.


anyone can help.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,570
2,612
363
cPanel Access Level
Root Administrator
Hey there! It really depends on the resources being used on the system. It would be best to evaluate what is causing so much swap to be used, and then you would be able to decide if increasing it will help the situation, or just lead to a bigger swap area getting full again.

If you are only using 50% of your RAM, is seems odd to me that swap would be completely full already.

Since this area isn't controlled by cPanel, you may need to reach out to your host to confirm the hardware is working properly on the system.
 

retechpro

Well-Known Member
Dec 23, 2022
141
16
18
Pakistan
cPanel Access Level
Root Administrator
Hey there! It really depends on the resources being used on the system. It would be best to evaluate what is causing so much swap to be used, and then you would be able to decide if increasing it will help the situation, or just lead to a bigger swap area getting full again.

If you are only using 50% of your RAM, is seems odd to me that swap would be completely full already.

Since this area isn't controlled by cPanel, you may need to reach out to your host to confirm the hardware is working properly on the system.
How can i verify why limit has been reached. Also how can i decrease now as it has been full.

which thing i need to verify to my server provider related to hardware.
 

quietFinn

Well-Known Member
Feb 4, 2006
2,041
551
493
Finland
cPanel Access Level
Root Administrator
Linux systems usually use swap before the RAM memory is full.
This will tell what is the swappiness parameter:
cat /proc/sys/vm/swappiness
 

quietFinn

Well-Known Member
Feb 4, 2006
2,041
551
493
Finland
cPanel Access Level
Root Administrator
swappiness value 10 means that swap will be used when RAM is 90% full.
That would indicate that in some point more than 90% of memory has been used.
I found instructions how to clear swap:

If swap usage is constantly high (and swap is big enough) it doesn't really help to increase size of swap, but you should add ram.
But then again, 128GB is quite a lot, so maybe you should try to find out what (and when) is using all your memory.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,570
2,612
363
cPanel Access Level
Root Administrator
We have some more details about dealing with swap here:

 
  • Like
Reactions: quietFinn

PeteS

Well-Known Member
Jun 8, 2017
390
88
78
Oregon
cPanel Access Level
Root Administrator
We have some more details about dealing with swap here:

FYI, this article needs to be updated to add the -a options for swapoff / swapon.