increase kern.maxswzone or reduce amount of swap.

Hi, I am new with FreeBSD. Can someone please tell me what this means?

dmesg:
Code:
warning: total configured swap (16777216 pages) exceeds maximum recommended amount (16129800 pages).
warning: increase kern.maxswzone or reduce amount of swap.
Code:
# freebsd-version
13.1-RELEASE-p7

# sysctl kern.maxswzone
kern.maxswzone: 0

top
last pid: 95048;  load averages:  0.60,  0.65,  0.67 up 0+00:39:31  11:30:38
105 processes: 1 running, 104 sleeping
CPU:  2.4% user,  0.0% nice,  0.4% system,  0.0% interrupt, 97.2% idle
Mem: 794M Active, 411M Inact, 1446M Wired, 40K Buf, 13G Free
ARC: 595M Total, 92M MFU, 485M MRU, 8069K Anon, 3746K Header, 7354K Other
     518M Compressed, 1526M Uncompressed, 2.95:1 Ratio
Swap: 64G Total, 64G Free
 
How much memory does the machine have? Looks like 16GB? Why do you have 4 times as much swap? Why do you think you need that much?

Anyway, just boot to single user mode, remove the current swap partition and create a new smaller swap partition. With 16GB of memory I wouldn't use any more than around 8GB of swap. Unless you have some specific reason for a lot more?
 
How much memory does the machine have? Looks like 16GB? Why do you have 4 times as much swap? Why do you think you need that much?
Yes there is 16GB mem. There is no specific reason for big swap space. Is that problem?
 
There is no specific reason for big swap space. Is that problem?
Yes, it's severe overkill. The old rule of thumb is to have 1.5-2 times the amount of memory. But that was when we still measured memory in megabytes. Nowadays you rarely need any more than 8GB.

Like I said, just boot to single user mode and remove/recreate the freebsd-swap partition.
 
Concerning the message itself: it is about fragmentation. Swap can receive data chunks of differing size, so when used it will fragment over time. Anyway an index table in memory is needed to keep track of what has gone into swap. And the memory for that table must be reserved beforehand, and it must be of appropriate size.
I once tried to figure out how that maxswzone would be correctly sized, but with no success. And nowadays it is 0 by default.
I think for a rarely used swap the message could be ignored. In any case, swap fragmentation can be monitored via sysctl vm.swap_fragmentation
 
Back
Top