At work I've been virtualizing our Windows servers to run under bhyve, and I've run into some memory-related issues. Namely, servers are crashing due to memory exhaustion, with the message: "pid XXXXX (bhyve), uid 0, was killed: out of swap space" which I assume means the host ran out of memory. For the time being, I've limited things to just running a single Windows server to aid in troubleshooting. While I will be adding more memory to the server, the current situation leaves me with a few questions; but first, let me provide some details.
Host: 4GB of memory, FreeBSD 11.1 (amd64), ZFS (prefetch disabled), no swap
Guest: Currently configured for 1GB of memory, Windows Server 2008 R2 SP1, utilizing on average ~1/3 of system memory within the guest
Memory graphs when guest crashes (via LibreNMS): Host - Guest
I realize there's not a lot a lot of breathing room with ZFS and even a single, 1 GB guest, but I would still think it should be doable. So what's going on? I'm speculating, but as the large cache from zfs doesn't leave much free memory, could it be that bhyve requests a sudden, large allocation, and before the cache memory can be freed up the allocation fails?
If so, the ideal solution would be to set FreeBSD to utilize memory for the ARC/ZIL caches until it would reduce free memory beyond a certain point; i.e. set a "reserve" amount for free memory. However, I'm not aware of any setting like this, so if there isn't, is the next best thing to set
Host: 4GB of memory, FreeBSD 11.1 (amd64), ZFS (prefetch disabled), no swap
Guest: Currently configured for 1GB of memory, Windows Server 2008 R2 SP1, utilizing on average ~1/3 of system memory within the guest
Memory graphs when guest crashes (via LibreNMS): Host - Guest
I realize there's not a lot a lot of breathing room with ZFS and even a single, 1 GB guest, but I would still think it should be doable. So what's going on? I'm speculating, but as the large cache from zfs doesn't leave much free memory, could it be that bhyve requests a sudden, large allocation, and before the cache memory can be freed up the allocation fails?
If so, the ideal solution would be to set FreeBSD to utilize memory for the ARC/ZIL caches until it would reduce free memory beyond a certain point; i.e. set a "reserve" amount for free memory. However, I'm not aware of any setting like this, so if there isn't, is the next best thing to set
vfs.zfs.arc_max
?