Tuesday, July 17, 2012

Physcial Machine to Virtual Machine migration Considerations (Solution Architect perspective)

There are many things to be considered while migrating application from physical machine to virtual machine. Four main things to be considered are: CPU, Memory required, I/O read write and Storage consideration. In terms of application perspective there are two major things an application / solution architect needs to consider – namely CPU and Memory requirement on the Virtual machine. In this article let us see things to be considered while calculating CPU and memory required for virtual machine.
CPU Clock Speed
Number of operations performed by CPU (Central Processing Unit) is called CPU clock speed or clock rate. This is usually represented in Hertz. Clock rates are determined based on testing of CPU against standard instruction set. Higher clock rates means CPU is able to perform more instructions within a specified time period.
While migrating application from physical machine to virtual machine, it is important to consider the clock rate of both hosted server (say X) and to be hosted (virtual machine) physical ESX server (say Y). Virtual CPU needed in ESX server = (X * Average CPU Utilization * Number of CPU Cores) / Y.
Are you all set for the calculation of Virtual CPU and Memory required? Is the formula for calculating Virtual CPU sizing correct? Of course it is correct; provided both the physical servers are of the same capacity. What do I mean? Assume the application is currently hosted out of IBM x 235 series server. Specification for this is: CPU Speed 2.67 GHz L2 Cache, 266 MHZ DDR (double data rate) with dual channel memory controller.  
Assume ESX server is going to be hosted out of HP DL 380 G7 – Xenon Processor E5606. Specification for this server is: CPU Speed 2.13 GHz 4-core, L3 Cache, 800 MHz DDR3 with 3 channels controller.
Can we use the above formula to find out the number of Virtual CPUs to be hosted out the new server? The above formula needs to be used with caution. Though the CPU speed of the new server looks less than that of the old server, the new server has more transfer rate to memory compare to the old server. Bits Transfer rate from CPU to Memory is much higher in case of second server. Why? Second server uses QPI (Quick Patch Interconnect) which transfers only memory request. QPI is much faster than FSB which transfers both memory and I/O Requests.
CPU Cache
CPU cache is a cache used by CPU to reduce the access time of CPU to access RAM. There are three types of Cache:
a.      L1 – Each Core has its own
b.      L2 -  Usually shared by some or all cores
c.       L3 – Usually shared by all cores.
More data in the CPU Cache increases the speed of the CPU operation. Direct comparison of CPU Speed between different CPU models may not be fully valid without considering CPU Cache.
In the above example, HP Server provides 8MB Level 3 Cache, which means CPU Operations will be faster if the data to be accessed are already cached in L3 Cache.
DDR3 Memory
Compared DDR2 Memory (IBM 235 machine), DDR3 Memory (HP DL 380) is faster two times. HP server offers 3 channels 800MHz Memory. That means 800 * 3 * 2 = 4.8 G Transfer of bits / second, which is much faster than what IBM machine provides. So direct comparison as in the following formula may not be fully valid:
Required Memory size needed on the Virtual machine = Amount of RAM * Average % Memory Utilization
Conclusion
Virtual machine configuration with respect to CPU and Memory needs to be done with more due diligence. When doing the virtual machine sizing, one needs to take into account of CPU Speed, memory access speed, CPU Cache, type of DDR memory used and memory bus speed (QPI or FSB).

No comments:

Post a Comment