[Systems] Sunjammer Swapping

James Cameron quozl at laptop.org
Thu Dec 31 18:33:39 EST 2015


Sunjammer has 12 GB of memory, and you're talking about 3.3% of it.

The "free -m" shows swap usage at 407 MB, which is 407 MB allocated by
processes that almost never reference it.  (Referencing it will
swap-in).

So as it stands now, that's 407 MB of memory that the system is
efficiently using for filesystem caching.

I would leave swappiness as it is, or even increase it.

However, you haven't shown the other side of the story; you've only
looked at the static data.  What is the swap-in rate?  "vmstat" will
show you the swap-in rate under the column "swap si".

Where the long term swap-in rate is zero, the swap is costing you
nothing, but is saving you physical memory.

It is like having more memory.

Yes, swap is slower than physical memory, but only when "swap-in" and
"swap-out" are non-zero.  There's no cost to swapped unreferenced data.

On Thu, Dec 31, 2015 at 11:05:59AM -0300, Samuel Cantero wrote:
> Hello guys,
> 
> I was checking Sunjammer and I found the currently we are swapping around 407
> MB but we have plenty of physical memory free yet.
> 
> Free -m shows:
> 
>                   total       used         free     shared    buffers    
> cached
> Mem:         11992     11673        319          0       1539       5981
> -/+ buffers/cache:      4151       7841
> Swap:         8191         407       7784
> 
> According to this, we have around 7841 MB free (~ 319 + 1539 + 5981). We must
> consider that buffers and cache memory are unused memory that Linux borrows for
> disk caching (for improve performance). But at the end this is free memory.
> Applications can dispose of it immediately.
> 
> So what are we swapping? The answer is the swappiness value. This is
> a tweakable setting that controls how often the swap file is used. A swappiness
> setting of zero means that the disk will be avoided unless absolutely necessary
> (we run out of memory), while a swappiness setting of 100 means that programs
> will be swapped to disk almost instantly.
> 
> By default, Ubuntu comes with a default value of 60 (cat /proc/sys/vm/
> swappiness). This means that the swap memory will be used quite often is the
> memory usage is over the half usage. I consider that we should lower this value
> to 10. With this setting, the swap memory will be only used when the RAM usage
> is around 90%. We want to avoid disk usage as long as possible.
> 
> Suggestions and comments are welcome.
> 
> Best regards,
> 
> Samuel C.

> _______________________________________________
> Systems mailing list
> Systems at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/systems


-- 
James Cameron
http://quozl.netrek.org/


More information about the Systems mailing list