RAM speed impact on OPNsense performance

Started by ksx4system, April 04, 2023, 10:53:54 PM

Previous topic - Next topic
While it's well documented how much RAM is recommended to use there's literally no information available about RAM speed impact on performance. Does it matter to use faster RAM on non-server platform (eg. prebuilt desktop PC from widely respected manufacturer so there's no ECC)?
HP ProDesk 600 G1 SFF (OPNsense latest stable)
i3 4160 / 8GB RAM / 60GB SLC SSD / Intel and Broadcom 1GbE NICs

have a nice day :)

April 05, 2023, 01:33:57 PM #1 Last Edit: April 05, 2023, 03:03:46 PM by dinguz
I would say 8GB for normal use. The actual firewalling part doesn't benefit from large amounts of memory, but if you have lots of logging/reporting going on that is stored locally, then you may need more than 8 GB. The effects of the RAM speed is negligible. If you want to minimize the risk of running into obscure / performance issues I would recommend running on bare metal, not virtualised.
In theory there is no difference between theory and practice. In practice there is.

my dec670 has 4Gb  and it runs great for my purposes.

April 05, 2023, 11:16:05 PM #3 Last Edit: April 05, 2023, 11:29:59 PM by ksx4system
Quote from: dinguz on April 05, 2023, 01:33:57 PM
I would say 8GB for normal use.

I agree but sadly you didn't read my post and/or didn't understand the question :(

Quote from: DEC670airp414user on April 05, 2023, 03:14:51 PM
my dec670 has 4Gb  and it runs great for my purposes.

Theoretically I would be fine with 4GB too (I haven't seen usage above 2GB yet but I've got myself 8GB just to be safe). Unfortunately you didn't read and/or understand my post too :(

Let me rephrase the question: how much does RAM clock speed (and probably CAS latency) matter in terms of OPNsense performance? Let's *completely* ignore how much RAM is used (or let's just assume it's 8, 16 or even 768GB - it doesn't matter whatsoever).
HP ProDesk 600 G1 SFF (OPNsense latest stable)
i3 4160 / 8GB RAM / 60GB SLC SSD / Intel and Broadcom 1GbE NICs

have a nice day :)

I would say that in the context of what you can influence, RAM speed does not matter much. For example, in the beast case, you could gain 70% by using DDR4-3600 instead of DDR4-2133 at its base speed.

However, this gain does not directly translate into a linear speed increase because of cache. Even if your application uses all of your available memory and does nothing but store and retrieve data, it could never exceed that 80% gain. For a typical firewall application, I would expect most of the used data to be cached, unless you have a hefty table-lookup like blacklists or whitelists. All of those accesses must be done by the CPU, which probably does more than just access memory (like hashing indices, for example), such that the impact of memory speed would rarely exceed 10%.

If this was different for typical applications (and I consider a firewall to be one of these), server manufacturers would strive more to get higher RAM speeds, but mostly, they still make do with DDR4-2133 and ECC, which even adds latency.

There are in fact applications with may benefit more from RAM speed, like large matrix arithmetic. As Seymour Cray once put it: "Virtual memory is memory that you don't have", but that is a special case.

So, in a sense, the sizing of the RAM matters, too: If it is too small, it will swap and that is way more bad for performance than lower performance RAM. Considering the higher price, I would rather get more than faster RAM. With Zenarmor, I see 10 GByte used on my OpnSense.
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005

1100 down / 440 up, Bufferbloat A+

April 13, 2023, 05:41:23 PM #5 Last Edit: April 13, 2023, 05:45:55 PM by ksx4system
Quote from: meyergru on April 06, 2023, 12:16:22 AM
such that the impact of memory speed would rarely exceed 10%.

Thank you for precise explaination.

Quote from: meyergru on April 06, 2023, 12:16:22 AM
Considering the higher price, I would rather get more than faster RAM.

Alternatively the same amount of RAM but using slightly cheaper parts.
HP ProDesk 600 G1 SFF (OPNsense latest stable)
i3 4160 / 8GB RAM / 60GB SLC SSD / Intel and Broadcom 1GbE NICs

have a nice day :)