Hi, my router is using more memory than usual. Current memory usage is at:
Total avail: 22%
Used: 63%
Cached: 11%
It's been this way for a few months now since getting a new cable modem forced on us by our ISP. It's in bridge mode.
I've read in the forums about using sync | echo 3 > /proc/sys/vm/drop_caches etc, but that hasn't helped (also tried using "echo 1" instead of 3), and I've read about the potential causes of high memory usage, etc.
All I'm trying to do is to get banIP to load. It used to work fine, despite my router not having the "approved" amount of memory (Archer C7 v2), but it all used to work fine with the same number of blacklists.
The router is running OpenWRT v23.05.3 and banIP v1.0.0-6.
What is a good way to go about debugging this to find out what's eating up all the RAM? I'm at my wit's end because I've read through multiple posts about this on these forums but I can't find a good way to determine this. I don't have many packages loaded on this OpenWRT and I haven't changed anything since I started using OpenWRT a few years ago.
True, but I'm talking a lot of RAM difference here. The last time I successfully loaded banIP a couple of months ago the RAM was at 55% free, or so. It is now 22%. I doubt lists are going to grow that much in two months.
I have considered reducing my blacklists, but I already did that about a year ago when I ran into a similar problem to this. It would be nice to figure out what's causing the RAM to be eaten, if possible.
As you experienced (similar to what others have as well) If you want to do anything with OpenWRT, 128mb won't work in 2024. (Honestly 256mb should be the minimum for OpenWRT as the base entry.)
Devices are so cheap now a days, $30-50 bucks for 1gb of RAM, it's no longer viable to use the cheap home routers for OpenWRT routers, rather use them as an access points only and buy a simple cheap router.
I am currently leaving a PC with a 2nd gen Xeon (I don't remember the specific model) and 4GB of RAM. And the truth is that the local network works really well for being gigabit. Keep in mind that I run a lot of things over the network. And local speed is something I need every day. I would tell you that if you have a plan or use the internet a lot for personal use with children or provide services. Put something more powerful with the possibility of expansion. That way you can increase your security to have more things in Open WRT.
PS: By plan I mean internet plan. And security to avoid attacks or have a VPN for when you are away from home. An old, though inefficient, machine usually works well. It's like putting jet fuel in a Honda Fit.
Thanks, @Beniamin, this is very interesting. I currently have a Raspberry Pi 4 Model B Rev 1.5 with 4GB RAM and am using it as a Pi-Hole. Would that be enough to run OpenWRT on, you think?
I could always use the ISP's modem / router thing as an AP. I wonder if it would be able to be a wireless AP in bridge mode?
This is not completely correct. You can avoid quite some openwrt-overhead when creating your image from src. I.e. I am running nginx, PHP8, sqlite3 (+15MB db) , pdns_recursor on 128MB (23.05.4). I prefere to shrink down instead of installing more and more "bloatware".
This actually makes me a bit nervous since it is dealing with swap and partitions and filesystem stuff.
Do I need a zram partition in order for this to work? I'm not sure what my partition or filesystem is on my router. Is there any chance it could hose my router if I don't have the right setup?
Ah, you don't have to be rude, I am asking a legitimate question.
After researching this topic a bit, it caused me concern since it seems a bit complex. But maybe not. I read about kernel modules and having to enable swap, etc. Maybe this package does all that automatically, I'm not familiar enough with it to know, and you didn't say. I just don't want to ruin my router configuration, so I asked. If you don't know the answer, just say so. No need for sarcasm.
Well, I installed zram-swap, rebooted the router, and then tried loading banIP, but banIP still ended up gradually using more memory until it got very low so I had to stop it before it crashed my router (because of low memory). This is what usually happens now. The swap never kicked in, unfortunately, this is a screenshot of right before I stopped the banIP loading process (swap is 100% free):