(Old Post) XP Performance Optimizations for XenDesktop and Provisioning Server vDisks

Performance Optimizations for XenDesktop and Provisioning Server vDisks
By Paul Wilson

Older post on XP xendesktop, but some information still applies.
Introduction
Many environments have already managed to streamline the image building process and already have familiarity with the many Windows XP performance and optimization tips. Both XenDesktop (XD) and Provisioning Server (PVS) support the Windows XP operating system and can benefit from performance enhancements. For those who are familiar with these performance enhancements, this blog may provide little assistance in the way of new information. None of the optimizations below are required, but they are available here for your convenience if they make sense in your environment.

The optimizations are put into three sections: Those that apply to the current user profile, those that apply to all users on the machine, and recommendations before creating the vDisk. The first section deals with the items that can be set in the default user profile. The second section deals with settings that can be set by the administrator for all users that work on the machine. The final section recommends a few things to do before taking the vDisk image. When available, the section will provide links to the URL on Microsoft?s website that explains the setting further.

Settings for the Default User Profile
This section lists a few of the settings that will improve the user experience but are set at the user profile level.  The recommendation is to create a generic user and then set the applicable settings, when completed, replace the default user profile with the generic user profile, the steps for which are found at the end of this section.

Force Offscreen Compositing for Internet Explorer
Turning this setting off removes any of the flickering that may display when using Internet Explorer through XenDesktop, by telling Internet Explore to fully render the page prior to displaying it. This is especially helpful on Internet Explorer 7.

Open Internet Explorer
Select Tools >> Internet Options from the menu
Select the Advanced tab
In the Browsing section, enable the checkbox for ?Force offscreen compositing even under Terminal Services?
Click OK to save the changes
Restart Internet Explorer
More information available at http://support.microsoft.com/kb/271246/en-us

Remove the Menu Delay
The Start menu has a built-in delay of 400 milliseconds. To speed the menu response time, follow these steps to remove the delay:

Start the Registry Editor (Regedit.exe)
Navigate to  HKEY_CURRENT_USERControl PanelDesktop
Set the value of MenuShowDelay to 0
Exit the Registry Editor

Remove Unnecessary Visual Effects
Disabling unnecessary visual effects such as menu animations and shadow effects that generally just slow down the response time of the desktop.

Right-click My Computer
Click Properties
Click Advanced
Click the Settings button under the Performance section
Click ?Adjust for best performance?
If you want to keep the XP Visual Style, scroll to the bottom and check the last box titled ?Use visual styles on windows and buttons?

Disable the desktop cleanup wizard
To stop the wizard from automatically running every 60 days:

Right-click a blank spot on the desktop, and then click Properties to open the Display Properties dialog box
Click the Desktop tab
Click Customize desktop to open the Desktop Items dialog box
Disable the ?Run Desktop Cleanup Wizard every 60 days? setting
Click OK twice to close the dialog boxes
More information available at http://support.microsoft.com/kb/320154

Disable Automatic Searching of Network Printers and Shares
Automatic search periodically polls your network to check for new shared resources and adds relevant icons into My Network Places if anything is found. If you wish to prevent XP from regularly searching your network unnecessarily then follow these steps:

Open the Control Panel
Select Folder Options.  If you use the Control Panel Category View you?ll find Folder Options under Appearance and Themes
Click the View tab
In the Advanced Settings list, disable the ?Automatically Search for Network Folders and Printers? setting
Click OK

Disable the Windows XP Tour Notifier
If you did not turn this off before you logged in as your base user for the default profile, you can manually disable the prompt on a per-user basis by following these steps:

Start Registry Editor (Regedit.exe)
Navigate to HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionAppletsTour
On the Edit menu, point to New, click Dword Value, type RunCount
Set the data value to 0 (zero), and then click OK
Quit Registry Editor
More information available at http://support.microsoft.com/kb/311489

Turn off Automatic Updates
Since you are running a read-only image, using automatic updates will cause the operating system to continually download the same updates each time the image is booted. The best course of action is to turn it off. You have three options that can be used to disable the service:

Use the PVS Optimizer tool and leave the ?Disable automatic update service? box checked
~ or ~

In the Services Control Panel, change the Startup Type of the Automatic Updates service to ?Disabled?
~ or ~

Run GPEDIT.MSC and navigate to:  Local Computer Policy > Computer Configuration >  Administrative Templates > Windows Components >  Windows Update. Set the ?Configure Automatic Updates? setting to ?Disabled?

Turn off Language Bar
If there is no need for the language tool bar (the pen icon in the systray) you can disable it using either of these two methods.

Right-click taskbar > Toolbars and uncheck the ?Language Bar? option.
~ or ~

Navigate to Control Panel > Regional and Language Options > Languages (tab) > Details (button) > Language Bar (button at bottom). Disable the ?Show the Language bar on the desktop? and ?show additional Language bar icons in the taskbar?.

Make the User Profile the Default User Profile
When you are done completing all the User Profile Settings (using a generic user) you can copy the profile over to the default user using the process below.

Login as an administrator (Local Administrator is recommended) not as the base user for the profile because you cannot copy a profile that is in use.

Right-click on My Computer
Choose Properties
Select the Advanced tab
Click the Settings button under the ?User Profiles? section
Select your base user profile where the changes above were made and click Copy To
Click the Browse button and browse to C:Documents and SettingsDefault User
Click OK once to save the path
Click the Change button under ?Permitted to use?
Enter Everyone
Click OK to save
Click Yes to confirm overwriting of the default user profile
NOTE: Before copying it over, be sure to remove any user or machine specific data for the ICA Client, the ICA Streaming Client, Password Manager, and EdgeSight. Since the image prep for these items is beyond the scope of this blog, I will save it for a topic another day.

If you would like to know more about user profile management in general, check out David Wagner?s blog on the Citrix User Profile Manager available at http://community.citrix.com/blogs/citrite/davidwag/.
Settings for the Machine
This section provides a list of the optimizations that will affect all users of the image. These settings are usually set after logging in as an administrator.

Power Configuration Settings
Two of the power settings can adversely affect the performance of PVS. One of them is the hard disk power savings. If the PVS server is using a local hard disk for the vDisk cache, you do not want the operating system to power down the local drive. The other setting is the Hibernate setting. The PVS Optimizer tool will disable hibernating, but you can manually do it as well. Here are the steps for disabling the power settings:

Open Control Panel
Select the Power Options applet
Select the Power Schemes  tab
For the default power scheme, set ?Turn off hard disks? setting to Never
Select the Hibernate tab
Disable the ?Enable Hibernation? setting
Click OK to save the settings
Delete the c:hiberfil.sys hidden file

Permanently Remove the Language Bar
If there is no need for the language tool bar to be installed at all, you can permanently remove it by running the following command from a command-prompt:

Regsvr32.exe /u msutb.dll

To reinstall it because you later found out you should not have removed it, you can run this command:

Regsvr32.exe msutb.dll
Disable TCP Checksum Offloading
This performance optimization is highly recommended by both Citrix and Microsoft for all Windows XP workstations that will be communicating over the network with other Microsoft resources. To work around this problem, turn off TCP checksum offloading on the network adapter using these steps:

Start the Registry Editor (Regedit.exe)
Navigate to the registry key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters
In the right pane, make sure that the DisableTaskOffload registry entry exists. If this entry does not exist, follow these steps to add the entry:
On the Edit menu, point to New, and then click DWORD Value.
Type DisableTaskOffload, and then press Enter
Click DisableTaskOffload.
On the Edit menu, click Modify
Type 1 in the Value data box, and then press Enter
Exit Registry Editor
More information available at http://support.microsoft.com/kb/904946/
Turn off Security Center
To disable the Security Center service, so users are not prompted when the firewall or anti-virus updates are out-of-date, you can disable it by peforming the following steps:

Open the Services Control Panel
Edit the Security Center service properties and set the Startup Type to ?Disabled?

Disable Last Access Time Stamp
Windows XP has a habit of time stamping all the files it reads with the date and time it was last accessed. While this is a nice feature, it is not always necessary in PVS environments where the files are statically supplied from a standard image and no backup software will be used. Putting a timestamp on a recently read file creates a write access every time a read is executed. With Provisioning Server, these writes go to the vDiskCache file increasing network traffic if cached on the PVS server. To disable the last access timestamp behavior, complete the following steps:

Start a command prompt
Type FSUTIL behavior set disablelastaccess 1 and press Enter
Requires a reboot to take effect

Disable the Windows XP Tour Notifier for New Users
Windows XP likes to notify all new users that an XP tour can be taken. While this is a nice feature for new users, it typically is annoying for existing users. To suppress the XP tour prompt for all new users, follow these steps:

Start Registry Editor (Regedit.exe)
Navigate to the registry key HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionAppletsTour
If the Tour key does not exist, follow these steps to create it:
From the Edit menu choose New
Click Key and type Tour as the key name
On the Edit menu, point to New, and then click Dword Value
Type RunCount as the name for the new value
Set the data value for the RunCount value to 0 (zero), and then click OK
Quit the Registry Editor
More information available at http://support.microsoft.com/kb/311489
Turn off System Restore
System Restore is the feature that allows a computer system to be rolled back, or restored, to a point before certain events took place, for example, prior to specific software or hardware installations. When you are using a standard mode (read-only) vDisk, there is no reason to have the System Restore feature enabled. The PVS Optimizer tool disables the System Restore feature, but if you are not using that tool, you should complete the following steps:

Right-click My Computer, and then click Properties
On the Performance tab, click File System, or press Alt+F
On the Troubleshooting tab, click to select the Disable System Restore check box
Click OK twice, and then click Yes when you are prompted to restart the computer
To re-enable System Restore, follow steps 1-3, but in step 3, click to clear the Disable System Restore check box
More information available at http://support.microsoft.com/kb/264887
Disable Windows Indexing Services
Windows Indexing service adds overhead to the PVS vDisk by reading the files from the vDisk for indexing. Use one of the following three methods to disable Indexing:

Use the PVS Optimizer tool and leave the ?Disable Indexing Services? setting enabled
~ or ~

To turn off indexing at the drive level, perform these steps:
Open My Computer
Right-click on the drive on which you wish to disable the Indexing Service
Select Properties
Under the General tab, disable the ?Allow the Indexing Service to index this disk for fast file searching? setting
~ or ~

To disable the indexing service at the service level, perform these steps:
Click Start, Run, type services.msc then press Enter or click OK
Scroll to the ?Indexing Service? in the right-hand pane and double-click it
Change the Startup type to ?Manual? or ?Disable? and Apply
Click the Stop button and wait for the service to stop then click OK

Modify the Windows Service Timeout
In environments with shift changes and large amounts of virtual machines rebooting some virtual machines may fail to register because the Windows Service timeout may be reached before Citrix Desktop Service starts.  The Windows Service default timeout is 30 seconds which may not be long enough for all the services to when the virtual machines are coming online simultaneously. We recommend changing the 30-second default to 120-seconds to give the services times to start before the Citrix Desktop Service starts.   The timeout value is represented in milliseconds so 60 seconds = 60000 ms.  The following registry change can be made to lengthen the Windows Service timeout period.

Start Registry Editor (Regedit.exe)
Navigate to the registry key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControl
If the ServicesPipeTimeout value is not present, use the following steps to create it:
Click the Control subkey
On the Edit menu, point to New, and then click DWORD Value
Type ServicesPipeTimeout, and then press Enter
Right-click the ServicesPipeTimeout key and then click Modify
Click Decimal
Type 120000, and then click OK
Quit the Registry Editor
Reboot for the changes to take effect

Disable Remaining Unnecessary Services
You can go through the list of other services that are configured on Windows XP and disable any ones that will not be used in your environment. Two possible services are the Wireless Zero Configuration service and the Themes service.
Enable ClearType
To enable ClearType and make any adjustments to suit your eyes, go to the Microsoft Typography pages and follow the simple instructions. You can adjust ClearType in the Control Panel after installing the software at the link.
Recommendations Before Imaging
Below is a list of recommendations that can be completed right before creating the vDisk image. Most of these are designed to optimize the layout of the files on the disk so that PVS server can operate at maximum efficiency.
Zero Deleted Files
SDelete is a secure file delete utility that can be used to free and cleanup unused space on the image. In short, it zeroes out any files that have been freed up by the operating system and helps the image run faster. For more information about how it works or to download it, visit the URL below. The recommended options are -z and -c. (sdelete -z -c)

Usage: sdelete [-p passes] [-s] [-q] <file or directory>

sdelete [-p passes] [-z|-c] [drive letter]

More information available at http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx
Defragment the Local Disk
Run the some type of disk defragmenter tool to optimize the files on the image. It is best to run the utility after removing the pagefile.sys and hiberfil.sys files. If you will use a page file, just re-enable it after you defragment the disk, that way the page file is contiguous. The Windows Defragmenter can be found at Start >> Programs >> Accessories >> System Tools >> Disk Defragmenter.
Flush the DNS cache
Flush the DNS Cache using the ipconfig /flushdns command. This prevents any IP addresses cached on the read-only disk from interfering with DNS resolution at a later date.
Run ChkDsk
Verify the file system has no missing file links or pieces by running chkdsk –f from a command prompt.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s