OPNsense Forum

Archive => 20.1 Legacy Series => Topic started by: Ricardo on June 16, 2020, 07:43:30 am

Title: How to utilize most of the RAM in the router?
Post by: Ricardo on June 16, 2020, 07:43:30 am
Hi opnsense folks!
I want to utilize the most of the RAM sitting in my router, and mostly idle (the dashboard says 600MB of the 4096MB is utilized, the rest looks not used.
I set up tmpfs for /var and /tmp, but thats only minimal size of files.
I use unbound DNS to cache records in memory, but thats also very minimal amount.
I use maltrail, but due to the current setup, it stores its files not under /var or /tmp,  but under /root, so its torturing the underlying ssd, and not the RAM.
I enabled netflow in the past, it consumed a significant amount of RAM, but the python scripts running in the background killed the already underpowered CPU as well, so I stopped it.
What other service(s) enabled would benefit from the plenty of available RAM, while keeping the CPU usage still low?
Title: Re: How to utilize most of the RAM in the router?
Post by: burn2 on June 16, 2020, 11:01:10 am
Hello.

if you use it on a virtual machine, you could see that it use 70% of the memory alocated.
I think that opnsense only report "memory use", and do not show you how much buffer it use.

I you know linux that it's to say that it only show from free -m "memory usage" and not buffer.
Title: Re: How to utilize most of the RAM in the router?
Post by: Ricardo on June 16, 2020, 12:44:20 pm
This is a dedicated hardware router (APU2), no virtualization is utilized (the router is neither a VM guest nor it runs as a VM host for other downlink VM guests).
Title: Re: How to utilize most of the RAM in the router?
Post by: burn2 on June 16, 2020, 12:50:47 pm
I know, but what i said is that it already used 70% of the memory but it does not show you in the interface.

On my case, if i take a look on the interface, opnsense says "16%" of memory used.
But on the host i see 70% of the memory used.
If i add more memory, it always use 70% (or something like that).

So has i said even if you do not see it on the panel because it report only "used memory", it already used something like 70% of the memory to buffer etc.
So like always in linux, all your memory is used by buffer in fact, and you could see it with free -m, but not sure if it's possible on the opnsense rom.
Title: Re: How to utilize most of the RAM in the router?
Post by: Ricardo on June 16, 2020, 12:58:20 pm
This is my current memory allocation details:

SYSTEM MEMORY INFORMATION:
mem_wire:         568782848 (    542MB) [ 13%] Wired: disabled for paging out
mem_active:  +    127094784 (    121MB) [  3%] Active: recently referenced
mem_inactive:+   2809913344 (   2679MB) [ 68%] Inactive: recently not referenced
mem_cache:   +            0 (      0MB) [  0%] Cached: almost avail. for allocation
mem_free:    +    603004928 (    575MB) [ 14%] Free: fully available for allocation
mem_gap_vm:  +      -217088 (      0MB) [  0%] Memory gap: UNKNOWN
______________ ____________ ___________ ______
mem_all:     =   4108578816 (   3918MB) [100%] Total real memory managed
mem_gap_sys: +    129896448 (    123MB)        Memory gap: Kernel?!
______________ ____________ ___________
mem_phys:    =   4238475264 (   4042MB)        Total real memory available
mem_gap_hw:  +     56492032 (     53MB)        Memory gap: Segment Mappings?!
______________ ____________ ___________
mem_hw:      =   4294967296 (   4096MB)        Total real memory installed

SYSTEM MEMORY SUMMARY:
mem_used:         882049024 (    841MB) [ 20%] Logically used memory
mem_avail:   +   3412918272 (   3254MB) [ 79%] Logically available memory
______________ ____________ __________ _______
mem_total:   =   4294967296 (   4096MB) [100%] Logically total memory


Does that mean I have plenty of un-itilized memory, that could be actively used for additional added value service?