mwan3 memory usage

Florian Eckert fe at dev.tdt.de
Thu Jun 15 05:30:21 PDT 2023


Hello,

> Hi,
>     We have enabled mwan3 (version 2.11.4) functionality with OpenWRT
> version 22.03 and we see that four mwan3rtmon processes are running,
> two each for IPv4 and IPv6.

We made the change with the following commit:
https://github.com/openwrt/packages/commit/566293d228a48d21a04ecbc815a7ae97e26eb319

I'm not sure, but I think we had before also two mwan3rtmon process
one for ipv4 and the other for ipv6 so there is no difference. But 
during
the change we switched to procd to control the rtmon services.

> Whereas with mwan3 (version 2.8.16) that came with OpenWRT version
> 19.07, has only one process for mwan3rtmon running for both IPv4 and
> IPv6.

Sure? Or did only use the proto ipv4.

> This has caused an increased memory usage on OpenWRT version 22.03 by
> 3 times when compared to OpenWRT version 19.07.
> This is a huge concern for us as we have limited memory on our router 
> product.

Because of the fact, that mwan3 is written in shell I would not 
recommend to use this on small devices.

> On debugging further, we see that mwan3rtmon script is invoking a
> child process, the reason behind observing two processes per each IP
> type.
> Refer(line number 155) at
> https://github.com/openwrt/packages/blob/master/net/mwan3/files/usr/sbin/mwan3rtmon
> Can we know the reason behind creating child processes?

Before that we polled for changes in the routing table. Now we use a 
event driven
patter to update the routing table on routing changes. Because of this 
we need
a subshell to get the events.

> To reduce memory usage, if we disable creation of child process, what
> functionality of mwan3 will be affected?

This is not recommended. However, you can use the old mwan3rtmon for an 
older version
to poll for changes. So you do not have a subshell for event handling.

> Also, is it recommended to use mwan3 (version 2.8.16) with OpenWRT
> version 22.03 as this has no child processes and only one mwan3rtmon
> process for both IPv4 and IPv6?

I can't say anything about that because I haven't tried it yet.

---
Kind regards

Florian



More information about the openwrt-devel mailing list