Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Dec 2017 19:23:15 +0800
From:      Marcelo Araujo <araujobsdport@gmail.com>
To:        Shane Ambler <FreeBSD@shaneware.biz>
Cc:        Allan Jude <allanjude@freebsd.org>, Dustin Wenz <dustinwenz@ebureau.com>,  freebsd-virtualization@freebsd.org
Subject:   Re: bhyve uses all available memory during IO-intensive operations
Message-ID:  <CAOfEmZjA7=nM%2BZ30BYqm%2BbfB3GtM73naGZKF4gXOGgZ3eJ=YWg@mail.gmail.com>
In-Reply-To: <e2638f47-30a2-95f6-7c52-31375b659903@ShaneWare.Biz>
References:  <F4E35CB9-30F9-4C63-B4CC-F8ADC9947E3C@ebureau.com> <a324b830-b941-2767-2272-957da680d997@freebsd.org> <F633EDFD-E9DA-47A3-AEFD-ED9C499FBD29@ebureau.com> <a0ecb7b5-feeb-fdfb-ae4e-f01c2973ad1d@freebsd.org> <e2638f47-30a2-95f6-7c52-31375b659903@ShaneWare.Biz>

next in thread | previous in thread | raw e-mail | index | archive | help
2017-12-01 17:53 GMT+08:00 Shane Ambler <FreeBSD@shaneware.biz>:

> On 01/12/2017 13:43, Allan Jude wrote:
> > On 2017-11-30 22:10, Dustin Wenz wrote:
> >> I am using a zvol as the storage for the VM, and I do not have any ARC
> >> limits set. However, the bhyve process itself ends up grabbing the vas=
t
> >> majority of memory.=C3=82
> >>
> >> I=C3=A2=E2=82=AC=E2=84=A2ll run a test tomorrow to get the exact outpu=
t from top.
> >>
> >> =C3=82  =C3=82 - .Dustin
> >>
> >> On Nov 30, 2017, at 5:28 PM, Allan Jude <allanjude@freebsd.org
> >> <mailto:allanjude@freebsd.org>> wrote:
> >>
> >>> On 11/30/2017 18:15, Dustin Wenz wrote:
> >>>> I'm using chyves on FreeBSD 11.1 RELEASE to manage a few VMs (guest
> >>>> OS is also FreeBSD 11.1). Their sole purpose is to house some
> >>>> medium-sized Postgres databases (100-200GB). The host system has 64G=
B
> >>>> of real memory and 112GB of swap. I have configured each guest to
> >>>> only use 16GB of memory, yet while doing my initial database imports
> >>>> in the VMs, bhyve will quickly grow to use all available system
> >>>> memory and then be killed by the kernel:
> >>>>
> >>>> =C3=82  =C3=82 kernel: swap_pager: I/O error - pageout failed; blkno=
 1735,size
> >>>> 4096, error 12
> >>>> =C3=82  =C3=82 kernel: swap_pager: I/O error - pageout failed; blkno=
 1610,size
> >>>> 4096, error 12
> >>>> =C3=82  =C3=82 kernel: swap_pager: I/O error - pageout failed; blkno=
 1763,size
> >>>> 4096, error 12
> >>>> =C3=82  =C3=82 kernel: pid 41123 (bhyve), uid 0, was killed: out of =
swap space
>
> That's the type of errors I see when wired jumps high. I'm not seeing
> this from bhyve but when your watching top, keep an eye on the wired
> amount.
>
> --
> FreeBSD - the place to B...Sharing Devices
>
> Shane Ambler
>
> _______________________________________________
> freebsd-virtualization@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to "freebsd-virtualization-
> unsubscribe@freebsd.org"
>

As Allan said, it is likely to be your ARC cache holding memory and
unfortunately right now all these swap out doesn't play well with the
combination of zfs + bhyve.

Try to tune your vfs.zfs.arc_max to a minimum where you give memory space
enough to your VM.

What I'm doing now is, launch a VM get the amount of memory and remove it
from vfs.zfs.arc_max, as soon as the VM stops, I give the memory back to
vfs.zfs.arc_max.

Best,
--=20

--=20
Marcelo Araujo            (__)araujo@FreeBSD.org
\\\'',)http://www.FreeBSD.org <http://www.freebsd.org/>;   \/  \ ^
Power To Server.         .\. /_)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfEmZjA7=nM%2BZ30BYqm%2BbfB3GtM73naGZKF4gXOGgZ3eJ=YWg>