{"id":82,"date":"2015-08-18T20:45:12","date_gmt":"2015-08-18T18:45:12","guid":{"rendered":"http:\/\/www.gerjon.com\/?p=82"},"modified":"2016-05-07T12:15:19","modified_gmt":"2016-05-07T10:15:19","slug":"windows-2012r2-slow-and-slow-vfp-visual-foxpro-databases","status":"publish","type":"post","link":"https:\/\/www.gerjon.com\/?p=82","title":{"rendered":"Windows 2012R2 and slow VFP (Visual FoxPro database) applications"},"content":{"rendered":"<p>We recently had a customer where we implemented a\u00a0Windows 2012R2, Citrix XenApp 7.5 environment to replace\u00a0a Windows Vista\/2008 client server environment. After implementing the new Citrix\u00a0XenApp environment\u00a0the customer found a strange phenomenon where several applications where performing\u00a0slower on the new XenApp servers then on the Vista workstations.<\/p>\n<p>When we ran several\u00a0tests on the environment and found that on a server with only the OS installed the applications worked fine. But\u00a0after installing the terminal server environment and the applications the applications that where using FoxPro databases (e.g. Accountview, Caseware etc.) where running significantly slower\u00a0andcrashing more often \u00a0than on the old Vista workstation environment\u00a0when performing specific functions inside the applications.<\/p>\n<p>The customer then did a installer by installer implementation of the Citrix server\u00a0while 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\u00a0the VDA agent but the problem would still persist.<\/p>\n<p>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<br \/>\n<span style=\"color: #000080;\">[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TSFairShare\\Disk\\EnableFairShare]<\/span> this has a setting of 1.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2015\/08\/disable-fair-disk-share-usage1.jpg\" target=\"_blank\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-84 size-medium\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2015\/08\/disable-fair-disk-share-usage1.jpg?resize=300%2C83\" alt=\"disable fair disk share usage\" width=\"300\" height=\"83\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2015\/08\/disable-fair-disk-share-usage1.jpg?resize=300%2C83&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2015\/08\/disable-fair-disk-share-usage1.jpg?w=742&amp;ssl=1 742w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>This settings allows Windows to normalize\u00a0Disk I\/O for users so they all have their fair share \ud83d\ude42 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&#8217;t receive data at a fast enough rate.<\/p>\n<p>After changing\u00a0the value to 0 the environment performed as espected!<br \/>\n(be aware that changing the registry can cause serious trouble, always create a backup!)<\/p>\n<p>There is a PowerShell command you can use to check the settings at a glance:<br \/>\n<span style=\"color: #0000ff;\">gwmi win32_terminalservicesetting -N &#8220;root\\cimv2\\terminalservices&#8221;<\/span><\/p>\n<p>The setting you need to search for\u00a0is\u00a0called:<br \/>\nEnableDiskFSS\u00a0 (Enable Disk fair sharing)<\/p>\n<p>There are also two other settings that could save your day if you disable them<br \/>\nEnableNetworkFSS (Enable network fair sharing)<br \/>\nEnableDFSS (Enable CPU fair sharing)<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2015\/08\/powershell-settings.jpg\" target=\"_blank\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-85 size-medium\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2015\/08\/powershell-settings.jpg?resize=300%2C100\" alt=\"powershell settings\" width=\"300\" height=\"100\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2015\/08\/powershell-settings.jpg?resize=300%2C100&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2015\/08\/powershell-settings.jpg?w=942&amp;ssl=1 942w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>And its also possible to change these settings via registry or PowerShell! <a href=\"http:\/\/www.ryslander.com\/disable-fair-sharing-in-windows-server\/\" target=\"_blank\">this<\/a> article has for more information on that.<\/p>\n<p>Besides these settings there are several thing you can do to get more performance from your Foxpro database environment<\/p>\n<p><strong>Hyper-V Generation 1 and 2 VM<\/strong><\/p>\n<p>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.<br \/>\nBeware that after creation of the virtual machine this setting cannot be changed!<\/p>\n<p>The setting\u00a0\u2018Generation 2\u2019 for the virtual machine has some advantages e.g. SCSI support and EUFI boot. These features may cause problems with\u00a0Visual FoxPro applications bacause of the type of driverse used. For more information read this article:\u00a0<a href=\"http:\/\/www.serverwatch.com\/server-tutorials\/hyper-v-2012-r2-pros-and-cons-of-generation-1-vs.-generation-2-vms.html\">Hyper-V 2012 R2: Pros and Cons of Generation 1 vs. Generation 2 VMs.\u00a0<\/a><\/p>\n<p><b>How to check what version the Virtual machine is:<\/b><\/p>\n<p>If you don&#8217;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:\u00a0<a href=\"http:\/\/windowsitpro.com\/hyper-v\/how-do-i-see-if-vm-generation-1-or-generation2\">How do I see if a VM is Generation 1 or Generation2?<\/a><\/p>\n<p><b>Running Foxpro on an Hyper-V platform with RDS\/Citrix?<\/b><\/p>\n<p>So when using Foxpro applications in a Hyper-V virtualised environment and using remote desktop services\/Citrix \u00a0preferably use a generation 1 VM. this will give better performance. more information can be found in these articles:<\/p>\n<ul>\n<li><a href=\"http:\/\/thebeagle.itgroove.net\/2014\/07\/30\/hyper-v-hellsort-of\/\">Hyper-V Hell\u2013sort of \u2026<\/a><\/li>\n<li><a href=\"https:\/\/social.technet.microsoft.com\/Forums\/windowsserver\/en-US\/7e649fce-b858-4546-a285-d3d5afb54ad8\/weird-app-behaviour-vfp9-under-server-2012-r2-and-hyperv?forum=winserverhyperv\">Weird app behaviour (VFP9) under Server 2012 R2 and Hyper-V<\/a><\/li>\n<\/ul>\n<p>there are 2 other settings you can alter (please test before putting it in production!) to get more performance:<\/p>\n<p><strong>Disable Digitally sign communications (always)<\/strong><\/p>\n<p>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&#8217;ve tested this (in a testenvironment on a domain controller) and\u00a0difference in speed was obvious \u2013 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.<\/p>\n<p>you can change these setttings via Group policy editor on the Windows 2012 R2 server<\/p>\n<p>Open up Group Policy Editor, and right-click-and-edit Default Domain Controller Policy.<br \/>\nGo to Computer Configuration\/Policies\/Windows Settings\/Security Settings\/Local Policies\/Security Options,<br \/>\nand set\u00a0<strong>Domain member: Digitally encrypt or sign secure channel data (always)<\/strong>\u00a0and\u00a0<strong>Microsoft network server: Digitally sign communications (always)<\/strong> to\u00a0<strong>Disabled<\/strong>.<\/p>\n<p>After changing the setting reboot the server just to be sure it works and test it thoroughly!\u00a0Beware that this setting is changed for all domain members when it is changed in the default domain policy!<\/p>\n<p>Worth noting: this\u00a0problem is for Domain controllers and shouldn&#8217;t be a problem on a non-domain-controller 2012 server. Beware on Windows Server Essentials 2012\u00a0these settings are also not set correctly!\u00a0Full article can be found here:\u00a0<a href=\"http:\/\/jrs-s.net\/2013\/04\/15\/windows-server-2012-slow-networksmbcifs-problem\/\">http:\/\/jrs-s.net\/2013\/04\/15\/windows-server-2012-slow-networksmbcifs-problem\/<\/a><\/p>\n<p><strong>Disable &#8220;Secure Negotiate&#8221; on the\u00a0Windows Server 2012<\/strong><\/p>\n<p>When running a Windows 2012 server and Windows 8 clients and and\u00a0Foxpro applications run slow this can be\u00a0caused by the &#8220;Secure Negotiate&#8221; 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).<\/p>\n<p>you can disable this by running the following command on the Windows 2012 server and\/or the Windows 8 clients:<\/p>\n<p class=\"sbody-pre\"><strong>Set-ItemProperty -Path &#8220;HKLM:\\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters&#8221; RequireSecureNegotiate -Value 0 -Force<\/strong><\/p>\n<p>The full Microsoft KB article can be found here:: <a href=\"http:\/\/support.microsoft.com\/kb\/2686098\">http:\/\/support.microsoft.com\/kb\/2686098<\/a><\/p>\n<p>Hope this helps solving issues in your environment and thanks ryslander.com, itgroove.net\/thebeagle, Microsoft &amp; jrs-s.net for posting the articles on which this blogpost is based<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We recently had a customer where we implemented a\u00a0Windows 2012R2, Citrix XenApp 7.5 environment to replace\u00a0a Windows Vista\/2008 client server environment. After implementing the new Citrix\u00a0XenApp environment\u00a0the customer found a strange phenomenon where several applications &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[22,21],"tags":[],"class_list":["post-82","post","type-post","status-publish","format-standard","hentry","category-remote-desktop-services","category-xenappxendesktop"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p59CpB-1k","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts\/82","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=82"}],"version-history":[{"count":0,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts\/82\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}