Remote Desktop 6.0, the latest version of Microsoft Remote Desktop client, which comes pre-installed with Vista was slower than molasses when I tried connecting to some Windows 2003 servers. In particular, I was trying to manage a Windows 2003 R2 64-bit Server running Exchange 2007 with 4GB of RAM and a fast 1.83Ghz dual-core processor. I'd click on something and wait and wait for my click to register. Moving a Window would also be painfully slow. It didn't seem related to network connectivity since the screen redraw was fairly fast, but it just took a long time for the server to respond to keystrokes, mouse-clicks, etc. It had all the earmarks of a server's CPU being overwhelmed.
But surely, this brand-spankin' new server will all this horsepower couldn't possibly be overloaded unless it had spyware or a virus. That wasn't likely either since I'm pretty diligent about protecting my servers. I logged on locally to the server and the server's performance was normal. Thus, only when I used Remote Desktop was it slow. Further, when I tried Remote Desktop from a Windows XP Professional PC, the server was also fast. It was only when I used Remote Desktop from my brand new Windows Vista Ultimate Edition PC that the performance was terrible. It was very odd, because from my Vista PC I could connect to many other machines with no problems. I was aware that Vista comes with a new RDP (Remote Desktop Protocol) client called Remote Desktop 6.0, which has more security and networking features, so perhaps there was some sort of network security conflict.
After doing some more research I discovered that Remote Desktop 6.0 leverages a new feature called auto-tuning for the TCP/IP receive window that could be causing the trouble. What is auto-tuning for the TCP/IP receive window? Well, the new Microsoft TCP/IP stack supports Receive Window Auto-Tuning. Receive Window Auto-Tuning continually determines the optimal receive window size by measuring the bandwidth-delay product and the application retrieve rate, and adjusts the maximum receive window size based on changing network conditions.
In Vista, Receive Window Auto-Tuning enables TCP window scaling by default, allowing up to a 16 MB window size. As the data flows over the connection, the TCP/IP stack monitors the connection, measures the current bandwidth-delay product for the connection and the application receive rate, and adjusts the receive window size to optimize throughput. The new TCP/IP stack no longer uses the TCPWindowSize registry values which many third-party utilities used to "tweak".
Receive Window Auto-Tuning has a number of benefits. It automatically determines the optimal receive window size on a per-connection basis. In Windows XP, the TCPWindowSize registry value applies to all connections. Applications no longer need to specify TCP window sizes through Windows Sockets options. And IT administrators no longer need to manually configure a TCP receive window size for specific computers.
According to Microsoft
, with Receive Window Auto-Tuning, a Windows Vista-based TCP peer will typically advertise much larger receive window sizes than a Windows XP-based TCP peer. This allows the other TCP peer to fill the pipe to the Windows Vista-based TCP peer by sending more TCP data segments without having to wait for an ACK (subject to TCP congestion control). For typical client-based networking traffic such as Web pages or e-mail, the Web server or e-mail server will be able to send more TCP data more quickly to the client computer, resulting in an overall increase in network performance. The higher the BDP and application retrieve rate for the connection, the better the performance increase.
The impact on the network is that a stream of TCP data packets that would normally be sent out at a lower, measured pace, are sent much faster resulting in a larger spike of network utilization during the data transfer. For Windows XP and Windows Vista-based computers performing the same data transfer over a long, fat pipe, the same amount of data is transferred. However, the data transfer for the Windows Vista-based client computer is faster due to the larger receive window size and the server's ability to fill the pipe from the server to the client.
With better throughput between TCP peers, the utilization of network bandwidth increases during data transfer. If all the applications are optimized to receive TCP data, then the overall utilization of the network can increase substantially, making the use of Quality of Service (QoS)
more important on networks that are operating at or near capacity. Obviously, this feature is good for ensuring better Voice over IP quality
In any event, I discovered that Vista's (Windows 7 as well) Receive Window Auto-Tuning could have issues on some networks. I really didn't want to disable Receive Window Auto-Tuning due to it's QoS, bandwidth speed/throughput, and VoIP quality benefits, but I had no choice. I use Remote Desktop all the time to manage 30+ servers. After disabling Receive Window Auto-Tuning, the "slowness" problem with mouse-clicks, keystrokes, and screen redraws went away. Problem solved! Woo-hoo!
Here is what you need to do if you have the same issue:
- Run a command prompt (cmd.exe) as an Administrator
- Type: netsh interface tcp set global autotuninglevel=disabled
Disable the autotunning feature in Vista completely, and fit and lock the RWIN receive window to default value 65536 bytes.
If you want to to re-enable it:
- Type: netsh interface tcp set global autotuninglevel=normal
In some cases you may need to use this command in addition to the above, but I didn't have to:
- Type: netsh interface tcp set global rss=disabled Update! This command makes your network connection EVEN FASTER
Type: netsh interface tcp set global autotuninglevel=highlyrestricted
The reason is that this command will still "auto tune" your TCP connections, but not as drastically as 'normal' mode. It will allow the receive window to grow beyond the default value, but again it will do so very conservatively
. In this mode, Vista will by default use RWIN (receive window) of 16,384 bytes with a scale factor of 2. I was browsing computers in my Network Neighborhood and trying to get to \\computername\c$ which was taking forever to load. I changed it to highlyrestricted and it was much faster. 'highlyrestricted' mode is my recommendation for the fastest network performance whether you are using Remote Desktop, Internet browsing, or doing SMB file copies across your network.
Now, because Receive Window Auto-Tuning increases network utilization of high-BDP transmission paths, the use of Quality of Service (QoS) or application send rate throttling is important for networks that are operating at or near capacity. So I'd like to get this feature working, which will require some network topology examination. I did read that Windows Vista supports Group Policy-based QoS settings that allow you to define throttling rates for sent traffic on an IP address or TCP port basis.
So perhaps I can just disable auto-tuning for the RDP port 3389 and leave it on for all other ports.
I'm headed over to Microsoft's site which has some excellent resources on policy-based QoS
. From my initial research it looks like you can configure some pretty nifty QoS policies. For example, you can specify a QoS policy with a DSCP value of 46 for a VoIP application, allowing routers to place those packets in a low-latency queue, or you can use a QoS policy to throttle a set of servers' outbound traffic to 512 KBps when sending from TCP port 443 (HTTPS port). In theory, I can set Remote Desktop to have "top" priority and give it all the bandwidth it needs. Heck, maybe I'll set just my IP address and my Remote Desktop port to have top priority on our network. To hell with the rest of my fellow co-workers! They don't need no stinkin' bandwidth. It's mine! All mine!
Now that I solved the slowness problem with Remote Desktop, it's time to head over to Amazon to check out their top Bluray deals of the week