Databases Reference
In-Depth Information
The preceding scenario is the basis of demand-based memory allocation features in modern
hypervisors. While VMware and Hyper-V have different approaches, their ultimate aim is the
same: to provide virtual servers with as much memory as they need but no more than they need.
That way, unused memory can be allocated to extra virtual servers that wouldn't otherwise be able
to run at all because of memory constraints.
In an ideal situation, if several virtual servers all request additional memory at the same time, the
host server would have enough free physical memory to give them each all they need. If there's not
enough, however, then the hypervisor can step in to reclaim and re-distribute memory between vir-
tual servers. It may be, for example, that some have been coni gured to have a higher priority than
others over memory in times of shortages; this is called weighting and is described in the next
section. The rules about how much memory you can over-provision vary by hypervisor, but the need
to reclaim and re-distribute memory is certainly something VMware's software and Microsoft's
Hyper-V could have to do.
Re-claiming and re-distributing memory ultimately means taking it away from one virtual server to
give to another, and from a virtual server that was operating as though the memory allocated to it was
all theirs, and it may well have been being used by applications. When this reclamation has to happen,
a SQL Server DBA's worst nightmare occurs, and the balloon driver we mentioned earlier has to inl ate.
We briel y mentioned the purpose of a balloon driver in the “Virtualiztion Concepts” section of this
chapter; however, to summarize its purpose, when more memory is required than is available in the
host server, the hypervisor will have to re-allocate physical memory between virtual servers. It could
do this to ensure that any virtual servers that are about to be started have the coni gured minimum
amount of memory allocated to them, or if any resource allocation weightings between virtual servers
need to be maintained, for example, if a virtual server with a high weighting needs more memory.
Resource weightings are described in the next section.
Different hypervisors employ slightly different methods of using a balloon driver, but the key point
for DBAs here is that SQL Server always responds to a low Available Megabytes value, which the
inl ating of a balloon driver can cause. SQL Server's response to this low-memory condition is to
begin reducing the size of the buffer pool and release memory back to Windows, which after a while
will have a noticeable effect on database server performance.
The advice from the virtualization vendors about how to coni gure their demand-based memory
allocation technology for SQL Server varies. Hyper-V is designed to be cautious with memory allocations
and will not allow the minimum amount of memory a virtual server needs to become unavailable,
while VMware allows the memory in a host server to be over-committed. Because of the potential
performance issues this can cause, VMware does not recommend running SQL Server on a host that's
had its memory over-committed.
Weighting
Finally, when there is resource contention within a host server, the virtualization administrator
can inl uence the order in which physical resources are protected, reserved, or allocated. This is
determined by a weighting value, and it is used in various places throughout a virtualization
environment — especially one designed to operate with contention. For example, an environment
might host virtual servers for production, development, and occasionally testing. The priority may
be for production to always have the resources it needs at the expense of the development servers
 
Search WWH ::




Custom Search