Perhaps of use to this discussion:
Perhaps of use to this discussion:
vm.v_free_target
vm.pageout_wakeup_thresh
vm.v_free_min
top -SHIz -mio
to see where your IO is coming from can be informative, too.But surprise, after 3 hours of use the system has not used a single byte of it !
I attach a picture for non "belivers"
vm.stats.vm.v_free_count < vm.pageout_wakeup_thresh
. If this condition hasn't been met since you've turned on swap, nothing will be paged out into the swap devices. (Unless you have vm.swap_idle_enabled=1, which will swap out (via vmdaemon) entire idle processes.)Did you ever try HardenedBSD https://hardenedbsd.org/ ?Snurg , thank you !
From time to time I will try to keep that document updated adding new things emergin here.
About, having X running non-root, I guess you are going face a difficult challenge. When it was achieved in OpenBSD it was commented as "incredible milestone", in 2014, see here:
http://undeadly.org/cgi?action=article&sid=20140223112426
Personally, I am sick of dealing with unsupported consumer hardware. When I use Linux/FreeBSD/OpenBSD for desktop use -- that is all days, since many years, I always run them inside a VMWare virtual machine. And happliy leave those problems to younger programmers
For people, like me, who do not know well how X works and do not know why it needs root privilege here is the explanation:
Did you ever try HardenedBSD https://hardenedbsd.org/ ?
I made a best effort summary of this thread, it is here:
https://docs.google.com/document/d/1cubX4cRAyk3dyOR5ed4t0dngQrhrUjCec6VXpMl8zC0/edit?usp=sharing
If somebody wants to partecipate in the editing let me know.
10 FACT. On ARM, especially BeagleBone Black, FreeBSD comes swapless by default.
I looked at the Google doc.
Thanks for the great outline. I was looking at #10 on your list. I think there's another reason, in addition to the one about swap "wearing out" the disks more quickly, for there being no default swap setup on some of the ARM images: ...
Yes, that particular sysctl is gone, but vim.disable_swapspace_pageouts still exists.
I think some of the distinctions drawn in that post (between paging and swapping) are worth noting in this discussion, too.
I personally tune these:
vm.v_free_target
vm.pageout_wakeup_thresh
vm.v_free_min
to adjust what amount of free memory the system tries to keep available. Depending on the system, workload, and goal, those may need to go up or down -- test for yourself to see if it impacts the behavior you are concerned about.
Refer to https://wiki.freebsd.org/AndriyGapon/AvgPageoutAlgorithm for what they're doing, or the explore the code itself if you're up for it: https://github.com/freebsd/freebsd/blob/master/sys/sys/vmmeter.h https://github.com/freebsd/freebsd/tree/master/sys/vm
Monitoring vm.stats while the system is “behaving poorly” ortop -SHIz -mio
to see where your IO is coming from can be informative, too.
No need to say sorry. Eric A. Borisch. Your input is extremely helpful!Sorry, it seemed like there was a more general discussion also going on of how swap/paging is used in FreeBSD, and some ways to influence it.
Could you give an example of how this works please? Like the method used to configure the values you listed for those parameters. Does it have any effect on processes running as root? This does not involve the zfs file system.
sysctl vm.pageout_wakeup_thresh=16384
or in /etc/sysctl.conf to set on boot.Buggy software 1, FreeBSD 0.almost all my problems with swap were caused by Firefox.
dd if=/dev/random of=1.file bs=1m count=2k
dd if=/dev/random of=2.file bs=1m count=2k
screen:
for i in $(seq 0 100); do echo $i; xz -9e -T 4 -k -f 1.file; done
for i in $(seq 0 100); do echo $i; xz -9e -T 4 -k -f 2.file; done
irb:
size = 500; a = [0] * (1024 ** 2 * size); nil
top -o res
tail -f /var/log/messages
cat 1.file 2.file > /dev/null # to grow up ARC
sysctl kern.ipc.shm_use_phys=1