[Feature Request] Ability to disable swap usage
Forum
  1. Forums
  2. General
  3. General Discussion
  1. bettinz
  2. Tuesday, 07 May 2013
  3.  Subscribe via email
Hello,
I know Cloudlinux use swap area as RAM, and you have tested this function. I know you say it works well, but on my system, there a lot of differences in speed time with CentOS and CloudLinux.

CentOS use swap only if RAM is not enough, and it\'s correct. Cloudlinux use swap if think that is better (with an algorithm I think).

But on my system, with 50% of ram free (1GB on 2GB), usage of swap make all the system slow.

I know you think it\'s a great feature, and maybe it works well with a lot of servers, but please, add the ability to disable this thing, and make CloudLinux use swap only if really necessary.

Thanks
Rate this post:
  1. 07.05.2013 04:05:34
  2. # 1
Igor Seletskiy Accepted Answer
Posts: 1195
Joined: 09.02.2010
0
Votes
Undo
CentOS will also use swap instead of purging disk caches in quite many cases. If you see your system being slow -- it is something else. It will not put things into swap if there is no pressure on a memory. The reason there are things in swap is that at some point there was no free memory, and instead of clearing disk caches being used, it put the programs into swap.
And if you see your system slow, and free memory available and swap being used -- it is for sure not swap, as the programs swapped out -- are not being used at all at that time, and cannot cause slow down.


Basically -- what I am saying -- something else is going on - and our support would be happy to investigate.
  1. 07.05.2013 05:05:09
  2. # 2
bettinz Accepted Answer
Posts: 12
Joined: 19.01.2013
0
Votes
Undo
Thank you for the reply, free -m says:

            total       used       free     shared    buffers     cached
Mem:          1869       1751        117          0        123        585
-/+ buffers/cache:       1043        826
Swap:         1999        447       1552


I've 826MB free, but the swap is used (427MB).
  1. 07.05.2013 05:05:03
  2. # 3
Igor Seletskiy Accepted Answer
Posts: 1195
Joined: 09.02.2010
0
Votes
Undo
No, you have 117MB free, the rest is used for disk caches/buffers, and given that swap is not being cleared out -- the programs that are in swap right now are sleeping, and not causing any issues...
  1. 07.05.2013 05:05:00
  2. # 4
Richard Hordern Accepted Answer
Posts: 212
Joined: 19.03.2011
0
Votes
Undo
On servers with 8GB ram or more I reduce the swapiness because the système swaps depending the a percentage of total ram used.

On servers with 32GB of ram or more we set swapiness to 0 to tell the système to only use swap when necessary.

With only 2GB of ram I don't know if it would be a good idea to reduce swapiness…
  1. 18.05.2013 03:05:33
  2. # 5
Vlassis Emmanouil Accepted Answer
Posts: 2
Joined: 18.05.2013
0
Votes
Undo
Swapiness is broken with CloudLinux. I have set it to 0 but i swap is always used even if there is enough memory free.
  1. 18.05.2013 06:05:10
  2. # 6
Richard Hordern Accepted Answer
Posts: 212
Joined: 19.03.2011
0
Votes
Undo
Maybe it depends what the system concicers to be enough free memory.

As you can see when you have enough free memory no swap is used :

free -m
             total       used       free     shared    buffers     cached
Mem:        257905     114855     143050          0      23216      78340
-/+ buffers/cache:      13299     244606
Swap:         7576          0       7576
  1. 23.05.2013 12:05:24
  2. # 7
Vlassis Emmanouil Accepted Answer
Posts: 2
Joined: 18.05.2013
0
Votes
Undo
True, but i prefer that swapiness value would be respected.
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.