Can I disable gl_monitor, gl_health?

Current firmware version 3.0.5 adds a lot of new functionalities and takes more RAM than v2.27 as a result.
Lighttpd takes about 7%, www/api takes about 6-7% and www/html takes about 4% memory. These are required for new web admin interface and I was told that GL-inet is trying to optimize them.

Apart from these, /usr/bin/gl_monitor takes about 2% and /usr/bin/gl_health also takes about 3% memory. Can you please tell me their purpose and whether they can be disabled or not? My device has only 64MB RAM and optimizing memory usage is very important for me.

… are you running out of memory somehow?

gl_monitor, it is a shell script, you can read it. It is in charge of monitor modem status, wan status and so on.

gl_health, this program is a binary file, it is in charge of repeater reconnect, it is very useful if you use the repeater for internet connection.

We’re working on improving the performance of MIIF, it is almost overload now.

1 Like

@kyson-lok @kennethrc

Thank you for your clarification. I use cable internet, thus I assume that I can safely disable those. I am using GL-AR150. The main memory is being consumed by admin panel. lighttpd is more memory intensive than uhttpd. Moreover you have another www/api binary which is also taking a lot of memory. Have you thought about using websockets rather than HTTP requests in the background? there is a Github repo called ‘lua-websocket’, I have used it on openWRT for my own hobby project to display realtime graph and syslog.

Also, I don’t know if this is due to openWRT upgrade or not, v2.17(using LEDE) used to have about 0.1 1-minute load average when the router was almost idle. But now it is always more than 1.0 and sometimes it goes around 5. eg: currently, it is: 5.07, 3.80, 2.31

Not currently after I disabled unbound. It was very memory intensive, taking about 4MB memory. In v2.27, I used to have about 19-20MB free total memory (free+buffered) but in v3.0.5, I have about 13-14MB.

Free memory is useless memory. That’s nothing to be concerned about.

I understand that. But a fresh install with factory default settings should not have only 10-15 MB free memory. Because I have my own packages to install. eg: collectd statistics, some of my own maintenance scripts. From my previous experience, if memory drops too low, the router restarts.

And this is only due to the new admin panel. I know that it very useful than before but it is memory intensive. openWRT started using luci (which uses very lightweight lua language) to optimise their performance.

Why not? Again, “free memory is wasted memory”. What does “top” on the device say? Where is the used memory allocated?

lighttpd 7%
www/api 6-7%
www/html 4%

nmbd, smbd 4%

gl_health 3%
gl_monitor 2%

hostapd, procd, rpcd, netifd, odhcpd, logd, ntpd, ubusd etc system processes are taking 2-3% each.

The top 3 memory consumptions are due to the admin panel. That’s why I was requesting to optimize it. I love the new admin panel. especially the VPN configuration UI and the software installation UI because those things don’t have such great UI in the luci interface.

No, those aren’t telling us the right information. ssh into the device and run “cat /proc/meminfo”.

if most of your “used memory” is merely “buffers” or “cache” then it’s doing what it’s supposed to, and like I keep saying nothing to worry about.

MemTotal: 59912 kB
MemFree: 9876 kB
MemAvailable: 23148 kB
Buffers: 6272 kB
Cached: 17604 kB

These are confusing. Different commands show the outputs differently. free shows some other outputs. The top command output and the luci web interface output matches. How ever as I read in some article, MemAvailable is the actual memory available for newly started program without swapping.

MemFree: The amount of physical RAM, in kilobytes, left unused by the system.

MemAvailable: An estimate of how much memory is available for starting new applications, without swapping. Calculated from MemFree, SReclaimable, the size of the file LRU lists, and the low watermarks in each zone. The estimate takes into account that the system needs some page cache to function well, and that not all reclaimable slab will be reclaimable, due to items being in use. The impact of those factors will vary from system to system.

I wish you’d included the full meminfo output (namely, the “anonymous” entries), but:

“Cached” and “Buffers” hold data and/or programs in memory, so they don’t have to be pulled from the far-slower flash memory, and most of that can be reclaimed if necessary. Not only that, inactive processes will have their memory reclaimed, and paged back in if they’re needed. Not only that, many programs link to shared libraries, which (depending on the tool) “contribute” to the size of a program, but they’re really only in memory one time, whether one program is using it, or 20.

As I’d said before, you have plenty of memory left over for anything reasonable you’d like to do with this box, stop worrying about it.

1 Like

Yup, he would probably have to optimize his programs if they really need 20mb or more ram on a router…

Thank you @kennethrc and @Johnex for your clarification.

Hi, @Johnex @kennethrc Just a quick question.

root@MrGhosh:~# cat /proc/loadavg
1.37 1.09 1.08 1/64 29235

I read that for a single core CPU, load avg of 1 means that the processor was optimally used. No process was waiting for CPU time. In my v2.27 firmware, the load averages were used to be around 0 (say, 0.11, 0.30 etc. because the system was mostly idle), but now, it is always more than 1 (the system is factory default and by always I mean it never comes below 1) and sometimes it goes around 3-4. Should I be worried?

You can look in Luci at the process list, check which processes are using most CPU. Ofc that while using the UI, or having it open, that is a lot of load on the cpu, the GL UI is doing many requests per second to update all the data.

Please have a look at the following screenshot. No process is taking much of CPU. Still, the load average never drops below 1. I am not using any UI (GL admin panel or luci) currently. Still such high load.

I was concerned about memory and you guys explained that it was fine. But I think that I should be worried about the CPU load. Should I open a new thread about this?

Moreover, I could not sort the results. This is busybox top and original top command’s switches are not working. How to sort the processes based on memory,cpu etc?

Well you can see yourself. Just 1 process is sitting there working, which is top. The other processes are idle.
Look a the cpu usage not the “load averages”.

Load average values are a very standard way to check system load. Those values don’t lie.

… talk about “making something out of nothing”. Good luck, I don’t know what you think you’re seeing. though.