Why swap memory is higher than real entered number?
-
Hello,
My server RAM is 8GB. When installing pfsense I entered 4GB for swap memory, but after installation swap memory is shows 8GB. I also tried fresh pfsense again, default swap memory is 2GB in installation processes and didn't change anything. After installation, swap memory is 4GB. Why is it so?
-
Are you using mirrored disks?
Where are you seeing the swap reported double? On the dashboard or somewhere else?
I spot checked a few boxes here and the dashboard shows a value matching what's actually there. You can double check in the shell using
swapinfo
. -
Yes, I am using 2 disk with mirroring in ZFS. I see it in Dashboard. I
the result of "swapinfo" command
Device 512-blocks Used Avail Capacity
/dev/da0p2 8388608 0 8388608 0%
/dev/da1p2 8388608 0 8388608 0%
Total 16777216 0 16777216 0%====================================================
the result of "top" command:
last pid: 66533; load averages: 0.12, 0.14, 0.14 up 69+02:24:42 22:40:19
51 processes: 2 running, 49 sleepingMem: 164M Active, 2375M Inact, 25M Laundry, 4749M Wired, 192K Buf, 593M Free
ARC: 2178M Total, 60M MFU, 1497M MRU, 3024K Anon, 55M Header, 563M Other
1173M Compressed, 8913M Uncompressed, 7.60:1 Ratio
Swap: 8192M Total, 8192M FreePID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
38331 root 1 24 0 293M 44984K piperd 1 2:07 0.88% php-fpm
33060 root 29 20 0 367M 246M nanslp 3 39:50 0.20% ntopng
31658 root 1 20 0 12736K 1876K bpf 2 35:05 0.00% filterlog -
Then that's why. You have swap on each disk, total is double.
It doesn't mirror swap, no need to do that.
-
Is it recommended to mirror swap or leave as double?
-
There is zero reason to mirror swap. It is not important data. It is temporary and volatile. Mirroring would slow swap down even more than it already is. Leave it as separate swap slices and keep it double.
-
Thank you very much for your clear answer.
-
I looked at carefully. Dashboard shows 4GB of swap memory, while top and swapinfo commands show 8GB of swap memory.
-
That's very odd. They should be both showing 4GB, no?
-
Are you on 2.4.4? Until 2.4.4, it did not count all swap partitions on the dashboard widget -- https://redmine.pfsense.org/issues/8587
-
I am using 2.4.3p1 version. It has been fixed in 2.4.4 release?
-
Yes, it has been fixed on 2.4.4. Follow the link I put above and you'll see.
-
Thank you very much.