New Content #13941


Memory usage in pfSense

Added by Marcos M about 1 year ago. Updated 12 months ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Questions frequently come up regarding memory usage in pfSense software. A doc on the subject could mention notes/quirks/etc. regarding pfSense specifically, rather than only defining terms. Examples below.

How does ZFS ARC affect the firewall? The note in the 23.01 release notes could be included in this doc.
  • On systems using ZFS, the first boot post-upgrade will appear to have higher than normal memory usage due to the large volume of filesystem activity that takes place during the upgrade process. This is harmless, however. This is due to ZFS arc memory usage, which it will yield as needed if other processes require more memory. Rebooting the firewall after the upgrade completes will return the reported memory usage to a normal level.
  • Wired is non-swappable memory (zfs arc, buffer cache, process tables, etc). Userland can also wire memory with mlock (database index uses for example). For a small memory systems, it may be beneficial to define a size for vfs.zfs.arc_max since it can otherwise use up to half the RAM which instead could be used for daemons, routing, and firewall states.

Some systems show Laundry memory and others don't. What is the significance of this from pfSense's perspective?

# system 1
last pid: 56922;  load averages:  2.12,  2.99,  1.80                                            up 0+02:31:40  13:47:08
610 threads:   3 running, 561 sleeping, 8 zombie, 38 waiting
CPU:  0.2% user,  0.0% nice,  0.6% system,  0.6% interrupt, 98.6% idle
Mem: 23M Active, 4096B Inact, 133M Laundry, 262M Wired, 372K Buf, 2032K Free
ARC: 35M Total, 17M MFU, 14M MRU, 164K Anon, 301K Header, 3543K Other
     6349K Compressed, 25M Uncompressed, 4.00:1 Ratio
Swap: 2048M Total, 2043M Used, 4588K Free, 99% Inuse, 92K In, 8192B Out

#system 2
last pid: 79940;  load averages:  0.29,  0.36,  0.32                                            up 1+01:47:10  18:08:37
449 threads:   5 running, 392 sleeping, 52 waiting
CPU:  4.2% user,  0.0% nice,  2.6% system,  0.0% interrupt, 93.1% idle
Mem: 583M Active, 2512M Inact, 2022M Wired, 40K Buf, 2761M Free
ARC: 1391M Total, 229M MFU, 1077M MRU, 1180K Anon, 13M Header, 70M Other
     1212M Compressed, 2763M Uncompressed, 2.28:1 Ratio
Swap: 1024M Total, 1024M Free

Actions #1

Updated by Marcos M about 1 year ago

  • Description updated (diff)
Actions #2

Updated by Jim Pingle about 1 year ago

  • Assignee set to Jim Pingle
Actions #3

Updated by Jim Pingle about 1 year ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 90

First step, I updated the breakdown of memory types in the graph text:

Some of the other info mentioned here is under ZFS tuning already:

Could still maybe use a generic document to tie that all together, but all of the relevant parts are covered between those.

I'm considering making a page under hardware for this and moving the bulk of the info from the graphs document there, and cross-referencing, but I'm not certain about that yet. The main way a typical user is going to see these amounts is in the graph.

Actions #4

Updated by Jim Pingle about 1 year ago

  • Status changed from In Progress to Feedback
  • % Done changed from 90 to 100

This should take care of things:

  • Add general memory info doc
  • Move bulk of memory info from graph list doc to new memory doc
  • Update system activity doc with more recent info (including info about memory usage)
  • Add xrefs to new memory doc and ZFS tuning in more places

Actions #5

Updated by Marcos M 12 months ago

  • Status changed from Feedback to Resolved

Looks great.


Also available in: Atom PDF