Monday, March 28, 2011

Transparent Memory Sharing on Intel Xeon 5500

Last week I was checking the performance of some recently installed Nehalem-based ESX servers in our server farm and found out that poor memory sharing was happening at VM level and also that memory consumption at ESX level was much higher than before changing hardware.


This surprised me because I know that one of the main advantages of virtualization is memory pages sharing. To give a little technical background, memory page sharing is a memory management technique where the hypervisor analyses and hashes all memory in the system and stores it in a hash table. Every one hour (but this is configurable), the hashes are compared and if identical hashes are detected, a further bit-by-bit comparison is performed. Then, if the pages have the same content, just a single copy is kept and multiple VMs memory are mapped to this shared page. The standard size for this pages is 4KB.

This is what VMWare calls Transparent Page Sharing (TPS) and, as you can see from the following screenshot, this is not taking place anymore for all of my migrated VMs.


After some investigation I discovered that this uncommon behaviour is due to the fact that my new ESX servers are running on a Intel Xeon 5570 CPU, which is member of the relatively new Nehalem based Xeon 5500 processor family. This family of procs implements Extended Page Tables (EPT), which is Intel's second generation x86 virtualization technology for the Memory Management Module (MMU).

For EPT to be really effective Large Memory Pages are used (up to 2048KB instead of the usual 4KB), but using such big memory pages really makes it unlikely that two identical pages of memory are found and therefore shared between different VMs.

This is why I am not seeing any memory page sharing taking place. So, what know that TPS is gone? Well, TPS is not completely dead. It is still there sitting behind the curtains and waiting for the right memory usage condition to pop it. In fact, happily enough, VMware does not let the performance benefits of the 2048KB page size come at the price of the old TPS mechanism: under heavy memory pressure (i.e. memory commit = 100%), the ESX will accept to break down the large 2MB memory pages into smaller 4KB memory pages in order for TPS to effectively kick in and begin sharing memory.

So it looks like just that I have to get used to this new behaviour and accept it. If this new mechanism can bring better performance without forcing the old good TPS to resign, well, it is warmly welcome!

For more information about EPT and the Intel Virtualization Architecture, check the Intel website.

If you found this article useful or if you want to share your opinion about this new behaviour, do not hesitate to leave a note or a comment!

Tuesday, March 22, 2011

Robocopy error codes

If you want a tool for copying or moving big folders containing many files through different filers, Robocopy is the best (in terms of security and reliability) solution that I have seen. The only problems is the number of different possible error codes which can show up in your logfiles. That's why I have decided to sum them up here in a post for easier troubleshooting:
  • ERROR 2 (0x00000002) The system cannot find the file specified.
  • ERROR 3 (0x00000003) The system cannot find the path specified.
  • ERROR 5 (0x00000005) Access is denied.
  • ERROR 6 (0x00000006) The handle is invalid.
  • ERROR 32 (0x00000020) The process cannot access the file because it is being used by another process.
  • ERROR 51 (0x00000033) Scanning Destination Directory: Windows cannot find the network path. Verify that the network path is correct and the destination computer is not busy or turned off. If Windows still cannot find the network path, contact your network administrator.
  • ERROR 53 (0x00000035) The network path was not found.
  • ERROR 58 (0x0000003A) Copying NTFS Security to Destination File:  The specified server cannot perform the requested operation
  • ERROR 64 (0x00000040) The specified network name is no longer available.
  • ERROR 112 (0x00000070) There is not enough space on the disk.
  • ERROR 121 (0x00000079) The semaphore timeout period has expired.
  • ERROR 1359 (0x0000054F) Scanning Source Directory:  An internal error occurred.
You could then use 
type *.log | find /i "0x00000005"
to retrieve all the access denied errors.


Or 
type *.log | find /i "0x00000070"
to retrieve all the errors due to insufficient disk space on the destination.

I hope you will find this resource useful!

Monday, March 21, 2011

Event id 1219

These days I have been struggling with a Windows 2003 box giving me an error event 1219 each time I tried to logon via RDP. It was some kind of weird problem which wasn't present when I logged on the local console nor on other Windows XP workstations.

I really did not know what to do, so I even decided to reinstall it. Unfortunately this didn't solve my problem.

Today I have finally found a working solution to this annoying event:

Event Type: Error
Event Source: Winlogon
Event Category: None
Event ID: 1219
Date: 21/03/2011
Time: 15:19:20
User: N/A
Computer: servername
Description:
Logon rejected for domain\username. Unable to obtain Terminal Server User Configuration. Error: The specified domain either does not exist or could not be contacted.

The solution is pretty had to find, so I reckon it is a good idea to share it:
  • Oper the registry (Start/Run/Regedit)
  • Navigate to HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server
  • Add a new DWORD Value named IgnoreRegUserConfigErrors
  • Set its value to 1 decimal.
  • Close the registry (no need to restart the server)
Try now to RDP into the server and everything should work perfectly.

I hope this helps. Please do not hesitate to comment if this post was useful!

vCloud Connector

I have just found and gone through an excellent VMWare slideshow on vCloud Connector. For those of you who don't know about it, VCloud Connector is a free VMWare virtual appliance and vSphere plug-in that let users view virtual machines in their private and public Cloud infrastructures and move them between the two.

Here's the link to the slideshow @ cinetica.it:


Happy reading!

IE9 offline installers for Vista and 7

If you are running Windows 7 or Windows Vista on your personal computer, you may want to download Internet Explorer 9 (IE9) which has been released one week ago by Microsoft.

IE9 main new featurer are its support for brand new HTML5 video and audio tags and the Web Open Font Format, as well as CSS3, SVG1.1 and ECMAScript5 which is the last version of the standard used by market implementations as Javascript or Jscript.

All these improvements are the reason why I have decided to share the links to download it:
Before downloading, please note that there is one big difference between the 32bit and the 64bit version of IE9: IE9 includes a new script interpreter (codename Chakra) which is much faster than the script interpreter in IE8. Furthermore, the 32bit version of IE9 also includes a Just In Time (JIT) script compiler which converts script into machine code before running it. There is no such JIT compiler for the 64bit version of IE, which brings poorer performances for this version.

Friday, March 4, 2011

Managing Windows services with Service Control (SC)

How many times you wanted to restart a Windows service and didn't remember the command line to do it. Here's a little memento for Service Control (SC) to use in these circunstamces.

Let's start with the command that will output the shortname from the display name:
SC GETKEYNAME "print spooler"
[SC] GetServiceKeyName SUCCESS  Name = Spooler
The other way around, to get the display name from the short service name type:
SC GETDISPLAYNAME spooler
[SC] GetServiceDisplayName SUCCESS  Name = Print Spooler
If you don't know the display name nor the short name for a service, just run the following command to get a list of all the existing services with their state:
SC QUERY state=all | FINDSTR "DISPLAY_NAME STATE"
...then check out the name of the service you are interested in. Once you know the exact service name, you can perform reconfiguration as follows.

To change the startup mode for a service (automatic, manual or disabled) use:
SC CONFIG ServiceName = [auto|demand|disabled]
This command will directly modify the DWORD key named 'Start' in the registry under HKLM\SYSTEM\CurrentControlSet\Services\ServiceName.

For Win32 services the possible values in the registry are:
  • 2 for automatic
  • 3 for manual
  • 4 for disabled
For example, the Printer Spooler service status is registered under HKLM\SYSTEM\CurrentControlSet\services\Spooler. If the status is started, the value of Start key is 2. If the status is stopped, the value of Start key is 3.

Now, to start a service:
SC START ServiceName
And to stop it:
SC STOP ServiceName
Other useful switches you might want to know for Service Control are:
  • query: Queries the status for a service, or enumerates the status for types of services.
  • queryex: Queries the extended status for a service, or enumerates the status for types of services.
  • start: Starts a service.
  • pause: Sends a PAUSE control request to a service.
  • interrogate: Sends an INTERROGATE control request to a service.
  • continue: Sends a CONTINUE control request to a service.
  • stop: Sends a STOP request to a service.
  • config: Changes the configuration of a service (persistant).
  • description: Changes the description of a service.
  • failure: Changes the actions taken by a service upon failure.
  • sidtype: Changes the service SID type of a service.
  • qc: Queries the configuration information for a service.
  • qdescription: Queries the description for a service.
  • qfailure: Queries the actions taken by a service upon failure.
  • qsidtype: Queries the service SID type of a service.
  • delete: Deletes a service (from the registry).
  • create: Creates a service. (adds it to the registry).
  • control: Sends a control to a service.
  • sdshow: Displays a service's security descriptor.
  • sdset: Sets a service's security descriptor.
  • showsid: Displays the service SID string corresponding to an arbitrary name.
  • GetDisplayName: Gets the DisplayName for a service.
  • GetKeyName: Gets the ServiceKeyName for a service.
  • EnumDepend: Enumerates Service Dependencies.
I hope this article was helpful!
Related Posts Plugin for WordPress, Blogger...