Windows 2012R2 and slow VFP (Visual FoxPro database) applications

Windows 2012R2 and slow VFP (Visual FoxPro database) applications

We recently had a customer where we implemented a Windows 2012R2, Citrix XenApp 7.5 environment to replace a Windows Vista/2008 client server environment. After implementing the new Citrix XenApp environment the customer found a strange phenomenon where several applications where performing slower on the new XenApp servers then on the Vista workstations.

When we ran several tests on the environment and found that on a server with only the OS installed the applications worked fine. But after installing the terminal server environment and the applications the applications that where using FoxPro databases (e.g. Accountview, Caseware etc.) where running significantly slower andcrashing more often  than on the old Vista workstation environment when performing specific functions inside the applications.

The customer then did a installer by installer implementation of the Citrix server while testing the application after each installer. During this time consuming test they found out that after the installation of the Citrix VDA agent the problem began and we could remove the VDA agent but the problem would still persist.

We then started calling Citrix and the application vendors to solve this issue and after a while we found that the problem occurs when during the VDA installation the Terminal Services role is installed. During the installation there is a settings called Disk enablefairshare that is set in the registry
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TSFairShare\Disk\EnableFairShare] this has a setting of 1.

disable fair disk share usage

 

 

 

This settings allows Windows to normalize Disk I/O for users so they all have their fair share 🙂 of the resources. This is what caused the problem because the FoxPro applications require a lot of disk I/O to perform and will immediatly cause issues when they don’t receive data at a fast enough rate.

After changing the value to 0 the environment performed as espected!
(be aware that changing the registry can cause serious trouble, always create a backup!)

There is a PowerShell command you can use to check the settings at a glance:
gwmi win32_terminalservicesetting -N “root\cimv2\terminalservices”

The setting you need to search for is called:
EnableDiskFSS  (Enable Disk fair sharing)

There are also two other settings that could save your day if you disable them
EnableNetworkFSS (Enable network fair sharing)
EnableDFSS (Enable CPU fair sharing)

powershell settings

And its also possible to change these settings via registry or PowerShell! this article has for more information on that.

Besides these settings there are several thing you can do to get more performance from your Foxpro database environment

Hyper-V Generation 1 and 2 VM

If you are using Hyper-V as your Hypervisor of choice there is an option to create a Generation 1 and and a Generation 2 VM on creating the virtual machine.
Beware that after creation of the virtual machine this setting cannot be changed!

The setting ‘Generation 2’ for the virtual machine has some advantages e.g. SCSI support and EUFI boot. These features may cause problems with Visual FoxPro applications bacause of the type of driverse used. For more information read this article: Hyper-V 2012 R2: Pros and Cons of Generation 1 vs. Generation 2 VMs. 

How to check what version the Virtual machine is:

If you don’t know if your VM is generation 1 or generation 2 you can check this by starting the VM in Hyper-V Manager. In the status bar at the bottom of the screen you can see the version. You can also do this via Powershell. More information can be found in this article: How do I see if a VM is Generation 1 or Generation2?

Running Foxpro on an Hyper-V platform with RDS/Citrix?

So when using Foxpro applications in a Hyper-V virtualised environment and using remote desktop services/Citrix  preferably use a generation 1 VM. this will give better performance. more information can be found in these articles:

there are 2 other settings you can alter (please test before putting it in production!) to get more performance:

Disable Digitally sign communications (always)

When running Foxpro databases over the network you can experience poor performance. When disabling this settings the speed of copying files between server and workstation can increase dramatically. I’ve tested this (in a testenvironment on a domain controller) and difference in speed was obvious – even folder listings were visibly faster, and copying a 15 MB file from a share to a client desktop went from taking 20+ seconds to being almost instantaneous.

you can change these setttings via Group policy editor on the Windows 2012 R2 server

Open up Group Policy Editor, and right-click-and-edit Default Domain Controller Policy.
Go to Computer Configuration/Policies/Windows Settings/Security Settings/Local Policies/Security Options,
and set Domain member: Digitally encrypt or sign secure channel data (always) and Microsoft network server: Digitally sign communications (always) to Disabled.

After changing the setting reboot the server just to be sure it works and test it thoroughly! Beware that this setting is changed for all domain members when it is changed in the default domain policy!

Worth noting: this problem is for Domain controllers and shouldn’t be a problem on a non-domain-controller 2012 server. Beware on Windows Server Essentials 2012 these settings are also not set correctly! Full article can be found here: http://jrs-s.net/2013/04/15/windows-server-2012-slow-networksmbcifs-problem/

Disable “Secure Negotiate” on the Windows Server 2012

When running a Windows 2012 server and Windows 8 clients and and Foxpro applications run slow this can be caused by the “Secure Negotiate” feature that was added to SMB 3.0 for Windows Server 2012 and Windows 8. This feature depends upon the correct signing of error responses by all SMBv2 servers, including servers that support only protocol versions 2.0 and 2.1. Some third-party file servers do not return a signed error response. Therefore, the connection fails (intermittently).

you can disable this by running the following command on the Windows 2012 server and/or the Windows 8 clients:

Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters” RequireSecureNegotiate -Value 0 -Force

The full Microsoft KB article can be found here:: http://support.microsoft.com/kb/2686098

Hope this helps solving issues in your environment and thanks ryslander.com, itgroove.net/thebeagle, Microsoft & jrs-s.net for posting the articles on which this blogpost is based

Leave a Reply