Viewable by the world


Kernel

Swap

My 48GB swap file system isn't fully recognized.

Q. What is the max amount of swap a system can use?
A. Are you sure you want/need that much swap anyway? The old-school 2-4x RAM doesn't really apply, though you may want a bit more than 1x physical RAM if you are capturing a crash dump, and some systems have >32GB RAM now. Swap can be limited by kern.maxswzone which controls the size of metadata use to track swap (8.X default is 64MB allowing ~15GB of swap). Note other changes are required to have >8x physical RAM for swap.

Q. What is this error: "swap zone exhausted, increase kern.maxswzone" if I didn't run out of swap?
A. kern.maxswzone is a kern var (configurable via loader.conf) which allocates memory virtual memory for storing metadata about swap. Default is something like 64 MB which allows around 14GB of swap to be utilized (http://lists.freebsd.org/pipermail/freebsd-stable/2007-May/034926.html). Default in 7.X is 32 MB. Further discussion http://lists.freebsd.org/pipermail/freebsd-hackers/2009-October/029616.html or http://blog.frankleonhardt.com/2011/large-swap-files-on-freebsd-die-with-mystery-killed-howto-add-lots-of-swap-space/.  To check on how much of your SWAPMETA is used:

[mane:~]# vmstat -z | perl -ne '$.==1&&print;/SWAPMETA/&&print'
ITEM                     SIZE     LIMIT      USED      FREE  REQUESTS  FAILURES
SWAPMETA:                 288,   116519,        0,        0,        0,        0

 

What is the best way to configure a swap backed /tmp?

Q. I want to use swap backed /tmp, but I understand it can be configured in multiple ways, including in /etc/fstab and the /etc/rc.* scripts. What is the best way to set this up?
A. Discussions here: http://forums.freebsd.org/showthread.php?t=3335, http://forums.freebsd.org/showthread.php?t=1561. Setting up from /etc/fstab: "md /tmp mfs rw,-s14336m,-oasync,-onoatime,-S,-Otime 0 0" (size, async, don't update access time, no soft updates, optimize for speed). Remember, you don't really want your system to swap, if it does, obviously, memory access slows to disk I/O speed. Via rc.conf:

tmpmfs="YES"                    # Set to YES to always create an mfs /tmp, NO to never
tmpsize="5g"                    # Size of mfs /tmp if created
tmpmfs_flags="-S -o async,noexec"  # Extra mdmfs options for the mfs /tmp, -S no softupdates

File Systems

Gjournaling

Are these log messages problems? "fsync: giving up on dirty" and "Cannot suspend file system"?

Q. These error messages show up frequently in messages: "fsync: giving up on dirty" and "GEOM_JOURNAL: Cannot suspend file system /xx/yy". Is this a problem? Is my journal having issues?
A. These messages are safe to ignore. http://www.mail-archive.com/[email protected]/msg196977.html Seems to be a harmless message that occurs under certain load conditions and indicates that a journal switch is pending.

  • No labels