[Systems] Sunjammer Swapping

James Cameron quozl at laptop.org
Fri Jan 1 19:20:54 EST 2016


Good questions.

No, it's not expected or desirable to have swap used, but seeing it
used is not a problem.

When a workload causes swapping, it is better to increase physical
memory or decrease workload.  But both of these require investment,
so swap is the next best thing.

Short peaks in workload are better handled with swap than not handled.

The evidence you gave showed a workload larger than physical memory.
I just couldn't tell whether it was a peak in workload (as Bernie has
identified) or an ongoing behaviour.

Yes, some systems are set up without swap.  When a peak in workload
exceeds physical memory, there are two outcomes;

- Systems with swap slow down, while they thrash with paging,
  substituting secondary storage (disk) for primary (RAM),

- Systems without swap fail, either by reporting an error to whatever
  program is allocating memory, or killing a process (Linux, OOM).

The design question then becomes; do you want a system to slow down or
refuse a transaction?

The OLPC XO laptops were originally set up without swap.  Recently
swap was added to the XO-1 in order to release about 32 MB of the 256
MB.

Virtual memory as a technology dates back to the 1970s, and my work
tuning VAX systems running VMS was most rewarding.  It is really nice
that virtual memory has stood the test of time.

On Fri, Jan 01, 2016 at 06:06:38PM -0300, Samuel Cantero wrote:
> It was my mistake to only look at the static result from the free -m command.
> However, according to munin, sometimes we have some pages swapped out to disk
> (I guess this is related to the swap-so column in the vmstat result). Of
> course, it is almost insignificant the size swapped out.
> 
> Anyway, just for curiosity and learning purposes: is it expected and desirable
> to have even few pages swapped out to disk? I always thought that the swap
> partition or swap file was created to avoid an OOM error in case of physical
> memory saturation. I have seen even some systems without a swap partition. One
> example: freedom.
> 
> Thanks and Happy New Year for all! :)
> 
> Best regards,
> 
> Samuel C.
> 
> On Fri, Jan 1, 2016 at 5:21 AM, Bernie Innocenti <[1]bernie at codewiz.org> wrote:
> 
>     On 01/01/2016 09:20 AM, Bernie Innocenti wrote:
>     > My guess is that an unusual event occurred in the past (perhaps months
>     > ago) caused the system to swap out a lot of stuff.
>     >
>     > After the errant process got OOM-killed, some of the memory got swapped
>     > back in, leaving in swap just the pages that were not referenced ever
>     since.
>     >
>     > There should be a munin graph showing swap I/O... and if it stays flat,
>     > we're good.
> 
>     The big swap event was in mid-July:
> 
>     [2]http://munin.sugarlabs.org/static/dynazoom.html?cgiurl_graph=/munin-cgi/
>     munin-cgi-graph&plugin_name=sugarlabs.org/sunjammer.sugarlabs.org/swap&
>     size_x=800&size_y=400&start_epoch=1417076284&stop_epoch=1451636284
> 
>     --
>      _ // Bernie Innocenti
>      \X/  [3]http://codewiz.org
> 
> References:
> 
> [1] mailto:bernie at codewiz.org
> [2] http://munin.sugarlabs.org/static/dynazoom.html?cgiurl_graph=/munin-cgi/munin-cgi-graph&plugin_name=sugarlabs.org/sunjammer.sugarlabs.org/swap&size_x=800&size_y=400&start_epoch=1417076284&stop_epoch=1451636284
> [3] http://codewiz.org/

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


More information about the Systems mailing list