(energetic music)
- Hi, everyone.
Welcome to another episode of OEMTV,
I'm Eric Mills with Microsoft.
I do Windows server marketing here,
and in this video, you're gonna get
a really in depth look at virtual machine settings,
specifically the CPU settings,
and the memory settings within Hyper-V.
So if you've created a virtual machine with Hyper-V before,
you know there are a lot of settings
that you can customize to set
that virtual machine up exactly how you want it,
and it's fine to accept the defaults,
but if you really want to get maximum performance
and utilization from your server,
then you want to dig into those a little bit.
So in this video,
Paul has set up four different virtual machines.
So there's a web front end,
there's a middle application tier,
there's a database tier,
and an active directory tier,
so four different virtual machines,
and he's gonna use Hyper-V Manager
to modify the CPU and memory settings.
So you'll get to see what dynamic memory looks like.
We'll talk about the memory buffer and the memory weight,
and the virtual CPUs,
and how many you can assign,
and how many you should assign.
We'll also talk about,
with each of those four different virtual machines,
how might you want to assign the memory and CPU
to get maximum utilization out of the entire stack,
from the front end all the way to the back end.
So if you set up a lot of virtual machines
for application servers,
or if you really just wanted to know the details
of how the CPU and memory settings
within the virtual machines are going
to affect your overall performance,
you're gonna love this video.
I hope you enjoy it.
We'll see you next time on OEMTV.
- [Paul] Thank you, Eric,
and hello everybody.
In this video, we're gonna look
at some of the settings in Hyper-V
that can affect your overall system.
So there's memory settings,
and there's CPU settings
that we'll be looking at,
and we'll roughly apply them to a real world situation.
First, an explanation of what we're looking at here.
What we've got is Hyper-V Manager
on Windows Server 2016,
and then we've also got Resource Monitor,
and in the Hyper-V Manager,
we've got several servers,
so there's a web front end,
there's a middle tier, there's a database tier,
and then active directory.
So this would me a three tier model,
standard three tier model,
with a directory for authentication
in case you want to do registrations
and those types of things.
Okay, let's look at active directory first,
and let's look at the settings,
and there are two major areas
that we want to focus on in this video,
because it's kind of a short video,
is memory, and then processors.
So for memory, one of the first things is,
and this happens when you're setting
up your virtual machine,
it asks if you want to enable dynamic memory.
So dynamic memory is just the ability of the system
to regulate the amount of memory
that the virtual machine gets.
So if it needs more memory from its basic starting point,
then it can obviously get that memory via dynamic memory,
and between multiple virtual machines,
the system moderates the memory allotment
to each virtual machine depending on the activity
that creates demand for that virtual machine
as it's more heavily used.
So I've got dynamic memory enabled here,
and I've also got this start up memory.
So specify the amount of memory
this virtual machine can use.
Well this really is a start up amount,
because if you've enabled dynamic memory,
then you can set minimums and maximums as well.
So then there's this memory buffer,
and this says "specify the percentage of memory
"that Hyper-V should try to reserve as a buffer.
"Hyper-V uses a percentage in the current demand
"for memory to determine an amount
"of memory for the buffer."
By default, they're all set at 20%,
and then there's also this memory weight,
and memory weight is basically you specify
how to prioritize the availability
of memory for this virtual machine,
compared to the other virtual machines on this computer.
So let's look at our environment here.
So we've got a web front end,
a middle tier, a database,
and active directory.
Now of these, which one would need the most memory,
or which one would have to have
the highest relative weight of accessing memory?
Well, if we kind of look at it,
a web front end, if you're using IIS,
and the data is cached, you know,
it's basically cached in memory,
well that might need a higher amount of memory,
or a higher reserve,
or even a higher priority of accessing memory,
because what if you start getting
a lot of hits really quickly?
And then the middle tier is probably,
it's the application tier, if you will.
So it might need a lot of memory,
but it also might need the dominant amount of CPU,
because those applications
are probably thick to some degree,
or heavy, and yeah,
they probably require memory,
but they also need a lot of CPU to execute them,
and then the database,
well databases need, we know they need I ops,
for sure, to get to the disc,
but they also need CPU,
and they also need memory,
but active directory,
I mean, what does it do?
It basically would authenticate requests.
So let's say it's a website where people have to log in,
and register to get something,
maybe a downloaded white paper,
or something along those lines.
I mean, a lot of this varies,
it depends on what the website's about,
what the environment's about,
but these are just some kind of guidelines
on how to adjust these settings.
So active directory in general probably
wouldn't need a lot of CPU,
it probably wouldn't need a lot of memory either,
and quite frankly, it probably wouldn't need a lot of disk,
because if it's only doing authentications,
then authentications are really light weight.
They're basically a request to authenticate,
and then a response.
So there's not a lot going on with them.
Now that said, if you got a lot
of policies in active directory,
that could change it as well.
So if the system has to look up a lot
of policies based on their authentication,
or based on their log on,
then that could get more demanding,
but if it's just in a website environment
where it's just used for authentication,
say of users that are logging in to that website,
then it probably wouldn't need a lot.
So how does that translate
into the settings here for memory?
We want it to start up quickly,
because it's one of those pieces of the architecture
that really needs to be on first,
because the other servers are gonna have applications
that will probably need to authenticate
against active directory.
So your start up RAM may want to be high to some degree.
So let's just give this five gigabytes,
and we've enabled dynamic memory,
but the maximum amount of memory,
we don't want it to be able to take everything right?
So let's just say what its maximum's going to be.
So let's say its maximum is now eight gigabytes,
and then in terms of memory buffer,
how much memory should you put aside?
How likely is there going to be a run on authentications,
or a run on the active directory?
And it's probably not very often,
so I'm gonna set this back down to 5%,
and then in terms of memory weight,
or prioritization, I'm gonna set this a little bit lower,
because we've got systems like the web front end,
and the database that are probably
gonna be at a higher priority
for the buffer and the memory weight.
Let's just go ahead and apply that,
and then in terms of processors,
so we've given this two virtual processors,
and I think that's probably enough,
they're fairly fast,
and then we started getting into this resource control,
where you can control the amount
of the resources that are given
in terms of the processors.
So with processors, there's two aspects.
There's the logical aspect,
meaning this machine has eight individual cores,
so it's got physical cores,
and then the virtual aspect,
so that's the virtual CPUs,
and CPUs in this case are basically
just a pool of resources,
it's just a pool of what appears to be a CPU,
but may not really correspond to a physical CPU,
but for active directory,
we've got two CPUs we really need active directory to be on.
So I'm going to reserve 50% of this environment, right?
So now we're getting 12% of
the total system resources applied to this virtual machine,
and then the virtual machine limit,
we're gonna leave that at 100%,
but we're gonna bring its relative weight down a little bit.
In other words, its weight relative
to the other virtual machines with those processors,
because we've now basically said
out of two processors,
we're going to give it one physical processor,
but compared to say the database,
or the front end, we don't really need it to be that heavy.
The front end is the critical piece, right?
If the web front end goes down,
or slows down because it doesn't have the right resources,
then you've really got problems.
Your customers will be upset.
We're gonna limit active directory
to a fairly large degree.
So if you get those,
now we can start looking at some of these others.
Well, the web front end,
it definitely needs to start up,
and two gigabytes to start,
because this machine is limited,
we're dealing with numbers that are somewhat small,
but two gigabytes to get this thing started
is probably pretty good,
and then we've enabled dynamic memory,
and then given it 64 megabytes of absolute minimum RAM.
So this would be the minimum
that it would fall back to,
it probably won't, let's put that to 128,
so it just has some memory to work from in the beginning,
and then we're gonna max it out at five gigabytes,
and then the buffer, well you know,
for the web front end,
a buffer of 20% is probably pretty good,
and then if we want to give it more weight,
because the website is critical.
So the web front end is critical to the business,
or to the environment,
so we're gonna give that a higher priority
for the availability of memory,
and the number of virtual processors is two,
because it's so critical,
let's bump that to four,
so we've got plenty of processor power on the front end,
and again, that's virtual processors.
So you're just taking four out of the pool,
you can assign four or more to the other systems as well,
and then I want to reserve, because there's four,
I want definitely at least one processor,
one physical processor,
to be associated with the web front end.
25% is one physical processor,
and then the virtual machine limit percentage,
we're just gonna let it run there,
and so the front end can now get 50%
of the total system resources,
and I want its relative weight to be 120,
so that it has a higher weight
than the ones that are at 100,
and we'll just go ahead and apply that,
and then the mid tier,
we talked about that a little bit,
let's go to its settings,
and it's got two virtual processors,
I think I'm gonna bring that,
again because this is probably a little bit CPU heavy,
I'm gonna bring that to four,
and in this case, we're gonna reserve 50%,
because the mid tier is gonna be a resource hog,
and then we'll leave the virtual machine limit to 100%,
so it now gets 50% of total system resources,
and leave its relative weight at 100.
Now the database.
For memory, the database definitely has to get more memory,
and we've got dynamic memory enabled,
minimum RAM, this is just going to settle down
to whatever it wants to,
and it may never reach that minimum,
but in terms of the maximum,
we want to give it 12 gigabytes of memory.
We know it's gonna need a lot of memory,
and then we'll leave its memory weight alone,
and then in terms of processors,
we're going to give it six processors,
because people are going to be doing analytics on it,
and that's what we need.
So in terms of reserve,
the database needs some degree of reserve,
so I'm just going to say 10% of the virtual machine reserve,
and that gives it 7% of the total resources,
and then we're just going to leave it alone
in terms of the virtual machine limit,
and in terms of the relative weight,
and apply those.
So we've given this machine a lot of settings,
why don't we now go ahead and start them up,
see what happens?
As they're starting, you can see the amount of memory
that has been assigned for them to start with,
and we've got this pretty good.
In other words, there's not a lot of free memory,
but there's a little bit of a buffer of free memory,
almost two gigabytes, and then the stand by
is actually the allocated memory from what we requested
to be the buffer.
All of this is the memory that's currently in use
because it's been assigned here,
but it will actually drop down
as these system start to moderate.
In other words, they're not going to continue
to use all of this memory.
That was just to show you how
the systems have settled down into the amount of memory
that they require at a minimum.
So if we now look over here at what's happening with memory,
in use is a little bit over four gigabytes,
and then you've got this standby,
which is from all of the reservations that we made,
and then a lot more free memory.
So hopefully you can see how that happens.
You have a particular start up memory,
the setting for processors as well,
and the system will use all of that memory to do startup,
but then once it settles down,
it goes into the dynamic memory,
and it modifies the amount of memory
that it is operating with.
I hope this information on CPU settings
and memory settings in Hyper-V
will be useful to you.
So thank you very much for watching.