Latency problem with RDP virtual channels on Windows 8/2012

Hello,

I'm seeing a problem with virtual channels when connecting to Windows 8 or Server 2012 over RDP, which does not happen with Windows 7 or older systems.

I'm using a request-reply type of protocol, where the server component sends a request to the client over virtual channel and client answers with the data. When RDP'ing into Windows 8, I get a very high turnaround time (16-18 milliseconds). There is no such problem when RDPing into Windows 7 or XP (turnaround time is less than 1ms). There are also no other problems with this RDP connection - it works good and fast, except virtual channel.

I can easily reproduce the problem with the test application and client dll that I've created. The program opens a virtual channel and sends 100 bytes of data. When dll receives CHANNEL_EVENT_DATA_RECEIVED notification, it replies with another 100 bytes of data. Basically it's just a simple ping.

What I've tried/checked already:

  1. Tried different Remote Desktop Client versions - same thing.
  2. Checked ping time between client and server machines, which turned out to be less than 1 ms (it is a Gigabit Ethernet connection).
  3. Tried with Dynamic Virtual Channels - same result.
  4. Tried reading/writing virtual channel with ReadFile/WriteFile through the handle returned by WTSQueryVirtualChannel() instead of WTSVirtualChannelRead/WTSVirtualChannelWrite - same result.
  5. Disabled checksum offloading in network adapter properties - same result.
  6. Tried different virtual channel priorities - same result.
  7. Tried with different amounts of data up to CHANNEL_CHUNK_LENGTH - same result.
  8. Disabled encryption (to the degree allowed by RDP settings) and compression.
  9. Played with other RDP options in Group Policy, which on my mind could affect the problem - nothing helped.

One other interesting thing I found with Wireshark when I tried to check if it was a TCP problem. I can see that the data goes to client only after 8-9 milliseconds after the call to WTSVirtualChannelWrite. The client's reply is received almost immediately (!!!), but WTSVirtualChannelRead call in my application completes only after another 8-9 milliseconds. Thus, resulting in a 16-18 milliseconds turnaround time.

Any ideas why this could happen?

January 13th, 2014 12:24pm

Update:

This is reproducible even with the standard ECHO virtual channel. I'm getting 16 to 18ms response time and sometimes more than 20ms.

Free Windows Admin Tool Kit Click here and download it now
January 14th, 2014 5:53am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics