[Systems] Sunjammer Swapping
quozl at laptop.org
Fri Jan 1 19:20:54 EST 2016
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
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 <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
> > 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:
> _ // Bernie Innocenti
> \X/ http://codewiz.org
>  mailto:bernie at codewiz.org
>  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
>  http://codewiz.org/
More information about the Systems