Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jun 2023 23:56:25 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>
To:        Aryeh Friedman <aryeh.friedman@gmail.com>
Cc:        Vitaliy Gusev <gusev.vitaliy@gmail.com>, FreeBSD virtualization <freebsd-virtualization@FreeBSD.org>, FreeBSD Mailing List <freebsd-questions@FreeBSD.org>
Subject:   Re: bhyve: how to keep the host from starving the guest
Message-ID:  <202306270656.35R6uPWS061316@gndrsh.dnsmgr.net>
In-Reply-To: <CAGBxaXkY70PSC1qb1VsJUq_3UG0K5M2HruBoC40c66wun%2BcseA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Mon, Jun 26, 2023 at 7:50?AM Vitaliy Gusev <gusev.vitaliy@gmail.com> wrote:
> >
> > Hi Aryeh,
> >
> > Have you wired a guest memory with bhyve's -S option?
> >
> > -S          Wire guest memory
> >
> >
> > Anyway, OS does not have another choice than kill a process to free some memory
> > when RAM+swap is fully used (assume kernel already scanned Inactive memory).
> >
> > As recommendation:
> >
> > Look at an another memory consumers like ZFS, another processes
> > Increase swap
> > Tune vm.overcommit sysctl. See tuning(7) for details.
> >
> >
> > So in short, there is no good way to run applications that fully use 10 GB
> > memory on a systems with just 1 GB RAM + 1 GB swap. You should have
> > enough resources to do that.
> 
> You completely mischaracterize the situation I want to reserve 16GB or
> 24GB for the VM and the other 8 are for the host (and the host
> alone).. I have already used the -S flag since it is required by
> passthru
> 
> Also the memory is successfully reserved accoring to top(1) but yet it
> still runs out (i.e. it shows 19GB are wired).

Are you running ZFS?
Have you restriced the memory that ZFS can consume so that it does
not run the system out of memory?

I suggest adding something like:
	vfs.zfs.arc_max=4294967296
to /boot/loader.conf

To restrict ZFS to using 4G of your 8G of memory you
have reserved for the host.


> --
> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
> 
> 
> 

-- 
Rod Grimes                                                 rgrimes@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306270656.35R6uPWS061316>