[Commotion-discuss] DR2 Memory Issues Is there a Quick Fix?

Ben West ben at gowasabi.net
Mon Oct 21 16:43:21 UTC 2013


Here is a comment I added to a recent github issue re: node memory
consumption and serval, suggesting enabling compressed swap as a
psuedo-workaround.

https://github.com/opentechinstitute/commotion-openwrt/issues/40#issuecomment-25683085

... I suggested adding the "zram-swap" package presently in OpenWRT trunk
to the commotion packages feed, and then enabling swap in kernelconfig.
This would let you enable compressed swap memory on nodes, and ideally make
the memory limit somewhat softer (i.e. help nodes avoid OOM errors and
processes crashing).

So, specifically, do make kernel_menuconfig and make these selections:
General Setup -> Support for paging of anonymous memory (swap) *
Device Drivers -> Staging drivers -> Compressed RAM block device support *

This kernel config change can also be done via a patch, and such a patch is
buried somewhere in openwrt-devel listserv archives (i.e. when the zram
package was originally announced).

Then copy the zram_swap package from trunk into commotionfeed and enable it.

For my nodes with 32MB of RAM, I specify 6MB swap in /etc/config/system:

config system
    ...
    option 'zram_size_mb' '6'

You can periodically check swap usage to ensure nothing is using excessive
RAM:

root at nsm5-b:~# free
             total         used         free       shared      buffers
Mem:         29184        24100         5084            0         2752
-/+ buffers:              21348         7836
Swap:         6140            0         6140

I should note this is only a *pseudo-workaround*, as it does not address
the underlying issue of excessive RAM consumption.  At best, zrap-swap
would allow the node to avoid OOM errors, and furthermore detect it is in a
low-memory state and actively do something about it (e.g. reboot).

I am running zram-swap as described above on WasabiNet nodes, both 5.8GHz
mesh backhaul and 2.4GHz mesh APs, and I can confirm that certain processes
*do not like to be swapped out*, freezing or behaving erratically as a
result.  hostapd, wpa_supplicant, olsrd, crond/busybox, and whatever your
captive portal agent is (nodogsplash or coovachilli), all certainly
shouldn't be swapped out.  Possibly commotiond too, although I've not had
opportunity to test that.

So, the zram_swap method described above lacks a bit in robustness.  I
think the *mlock* command can be used to prevent specific processes from
being swapped out, although I'm uncertain of whether OpenWRT has this tool
integrated.



On Sat, Oct 19, 2013 at 8:47 AM, Dan Staples <
danstaples at opentechinstitute.org> wrote:

> Hey Dan,
>
> Disabling Serval won't affect the splash screen, but it will prevent
> local app announcements from automatically propagating. Here's how to
> turn it off/disable it:
>
> /etc/init.d/serval-dna disable && /etc/init.d/serval-dna stop
>
> Let me know if that doesn't solve the problem!
>
> best,
> Dan
>
> On 10/19/2013 04:56 AM, Daniel Hastings wrote:
> > I was wondering if there was a quick fix to the memory issue that causes
> > the nodes to crash in DR2.  I know that Dan had mentioned that you could
> > disable serval even though it disabled the splash screen.  Even that is
> > the case I'm ok with it as long as if fixes the memory issue for the
> > time being. Any quick simple explanation would be extremely helpful.  We
> > are having some serious issues with nodes crashing repeatedly on end
> > over here.
> >
> > Thanks again!
> >
> > Dan
> >
> > --
> > *Dan Hastings*
> > /Abaarso School Computer Science Department/
> > dhastings at abaarsotech.org <mailto:dhastings at abaarsotech.org>
> >
> >
> > _______________________________________________
> > Commotion-discuss mailing list
> > Commotion-discuss at lists.chambana.net
> > https://lists.chambana.net/mailman/listinfo/commotion-discuss
> >
>
> --
> Dan Staples
>
> Open Technology Institute
> https://commotionwireless.net
> OpenPGP key: http://disman.tl/pgp.asc
> Fingerprint: 2480 095D 4B16 436F 35AB 7305 F670 74ED BD86 43A9
> _______________________________________________
> Commotion-discuss mailing list
> Commotion-discuss at lists.chambana.net
> https://lists.chambana.net/mailman/listinfo/commotion-discuss
>
>


-- 
Ben West
http://gowasabi.net
ben at gowasabi.net
314-246-9434
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chambana.net/pipermail/commotion-discuss/attachments/20131021/00d15630/attachment.html>


More information about the Commotion-discuss mailing list