VM Guest Memory – Watch these numbers !


I have been using VMware vSphere client for a while now and the person who inspired me to use this wonderful tool is none other than Brent Ozar(B/T).I’m a great fan of his webcasts.

In this blog post we will discuss some crucial information related to memory which can be monitored using vSphere client.

One of the major factor which affects a VM performance is the amount of memory which is allocated to it, and you all knew it.

Let’s assume this situation. You need to setup SQLServer on a virtual environment and you requested your VMware admin to allocate 3GB of memory for the VM guest. [3 GB is so low a number these days, but this is just for an explanation]

The VMware admin sets up the guest and confirm that it has got 3 GB of memory.

Do you really think that this whole 3GB is dedicated for this VM ?

To understand the concepts really clear, we will need to see the VMware guest memory allocation numbers, this view is available under the resource allocation tab after choosing the VM –

 

So what all are these numbers?  Private, Shared, Ballooned !!!

Let’s look at the definition of each of them –

Note –  I have read extensively to understand how memory management is done by the hypervisor and have given proper credits & references FOR all the information which is mentioned in this blog post.

Active Guest Memory Amount of memory recently accessed.
Private Guest Memory Amount of memory backed by host memory and not being shared.
Shared Guest Memory Amount of the virtual machine’s memory being shared.
Ballooned Guest Memory Amount of the virtual machine’s memory reclaimed by ballooning.
Compressed Guest Memory Amount of the virtual machine’s memory in compression cache.
Swapped Guest Memory Amount of the virtual machine’s memory reclaimed by swapping.
Unaccessed Guest Memory Amount of the virtual machine’s memory never referenced by the guest.

[ Ref  – http://pubs.vmware.com/vfabric5/index.jsp?topic=/com.vmware.vfabric.tc-server.2.6/em4j/em4j-monitoring-web-client.html ]

In the above figure Active memory is 368 MB. Active Guest Memory is defined as the amount of guest memory that is currently being used by the guest operating system and its applications.

[ Ref- http://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdf ] 

Private memory is configured memory – shared memory , ie 3072 MB – 692 MB = 2380 MB (2.32 GB)

This amount of memory is can be definitely utilized by the VM and nothing shares it.

Shared memory this is the amount of memory shared by TPS (Transparent page sharing).

The best explanation I could ever find for TPS is from this VMware white paper http://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdf

” When multiple virtual machines are running, some of them may have identical sets of memory content. This presents opportunities for sharing memory across virtual machines (as well as sharing within a single virtual machine). For example, several virtual machines may be running the same guest operating system, have the same applications, or contain the same user data. With page sharing,the hypervisor can reclaim the redundant copies and only keep one copy, which is shared by multiple virtual machines in the host physical memory. As a result, the total virtual machine host memory consumption is reduced and a higher level of memory over commitment is possible.”

Ballooned memory This should be zero ideally. Ballooning is a memory reclaim process and it’s done by the balloon driver which is installed on the guest. When ever the host memory is low, the balloon driver will reclaim memory from guest for the host.

Compressed memory This should again be zero ideally. When a virtual page has exhausted transparent page sharing and ballooning it must be swapped to disk. Starting vSphere 4.1, there is an attempt first to compress the page and store it in the virtual machine’s compression cache.

[ Ref http://www.vmware.com/files/pdf/techpaper/VMW-Whats-New-vSphere41-Performance.pdf ]

Swapped memory is the amount of memory which is swapped, again this should be ideally zero. Swapping is a process which comes in only if TPS and Ballooning don’t help and cannot reclaim memory. At virtual machine startup, the hypervisor creates a separate swap file for the virtual machine. Then, if necessary, the hypervisor can directly swap out guest physical memory to the swap file, which frees host physical memory for other virtual machines.

[ Ref http://www.vmware.com/files/pdf/techpaper/vsp_41_perf_memory_mgmt.pdf ]

Conclusion

This post should give you an idea about the important memory numbers which you should monitor.

Thanks for reading.

How many SQL Servers you run within your environment ? – MAP could be your best bet to answer this question !


A blog post about Microsoft Assessment Planning Toolkit was in my list for quite a while and today I decided to write about it.

Let’s assume that you are working for a pretty large organization and there are a lot of database servers running within the environment.

One fine day companies CTO or even the DBA manager walks to desk and taps your shoulder to ask this question –

“How many SQL Servers are we running here?

In case you are maintaining a proper repository after building each and every server,then the answer could be given fast.

If you dont have any repository and you don’t maintain a registered server list,then the question can be as good as a direct punch !

A smart DBA is one who has the right set of tools to get the right information at the right time.

We have a great tool called Microsoft Assessment Planning Tool Kit which does a great job to provide you sufficient information to answer the above question and much more. There are lot many features available this tool kit and we will try to cover few of them.

A very recent copy of MAP was published last month and currently the version is 7.0.The tool kit can be downloaded from here.

Normally I prefer to run this tool on my laptop or work machine to pull information/reports and I never do this install for a server.

In case you are running the old Windows XP OS within your laptop or work machine, then there is bad news. The latest version will work only for the below mentioned OS –

  • Windows 7 with Service Pack 1 (Professional, Enterprise, and Ultimate editions only)
  • Windows Vista with Service Pack 2 (Business, Enterprise, and Ultimate editions only)
  • Windows Server 2008 R2 with Service Pack 1
  • Windows Server 2008 with Service Pack 2

Now lets do MAP install and see how cool this tool is all about.

Once the setup is downloaded we can run the same to start the whole install process. The setup will do some initial checks like disk free space availability etc and will give you this screen.

The summary clearly states that the setup will install SQL Express LocalDB too along with the tool. Later on we will see why SQL express is required for the tool.

The install is pretty fast and once the setup is completed first launch screen looks like below

The initial setup screen will prompt us to create a database.

In this walk through we will name the database as ServerInventory. Clicking on OK will create the database for us.

Once the database is created, the initial screen will show us the details of steps to be completed.

We will now do Perform Inventory step. Clicking on GO will lead us to the below screen

This window will confirm how powerful this tool is. You can collect inventory of multiple application servers and even Oracle/MySQL and Sybase.

We are interested in SQL Server and will select the option SQL Server with Database details. Clicking on next will lead us to the below screen which will ask us which method we need to use to discover the servers. For this demo we will choose a single server, hence will select the option as below

The next 2 screens will deal with adding a computer name and the credentials. Final action will be to hit Finish and the assessment will begin

Once the assessment is completed, we can close this window and can start exploring the reports under Scenario Status section.

We can click on the view option of SQL Server Discovery report to get a very neat formatted report of instances available for the particular server.

In case you are interested only in total Database Engine instances, then the section to look at is Microsoft SQL Server Database Engine Editions section.That will give you an accurate count.

Another report which looked really cool to me is the Software usage tracking report.

Another report which excites me a lot is the Virtual Machine Discover Results report –

Conclusion

MAP tool has great potential and it allows you to make crucial business decisions during consolidation efforts.

Thanks for reading.

Capacity considerations while moving SQL workloads to a Virtual world !


One of the most basic capacity considerations involved while planning to move SQL workloads to a virtual environment is to understand the maximum capacity of a single Virtual Machine (VM.

Many times questions arises in mind like “what is the max memory which a VM supports?”

Look at what one of the leading platform VMware vSphere 5 Enterprise Plus offers for a single VM –

These are pretty heavy numbers, and good enough to handle a tough SQL workload.

Windows Server 2012 Hyper-V also looks really promising [The RTM bits are scheduled to be released by Aug 12]

64 vCPUs per VM is really impressive and some other numbers which impressed me with Windows Server 2012 Hyper- V are –

Active VMs per Host  – 1,024

Maximum cluster nodes – 64 and Maximum VMs in a cluster – 4,000

Both VMware and Microsoft improved a lot when it comes to capacity per VM and thats really a good news.

Conclusion

Capacity limitation is not anymore a reason for you to move your SQL workloads to a virtual world. Come on in,the water is warm !!!