This article is a compilation of several articles on the topic of networking (particularly multicast messaging) for Windows Server that I had previously written. Many of the hits on this blog recently have been for these articles, so I figured it was time to compile all my learnings from several years of working with high-throughput applications on Windows in one convenient place.
Sub-par Performance because of Power-Saving Features
Both Windows as well as network interface cards (NICs) come with various power saving features. The default settings are usually a compromise between energy efficiency and performance. For optimal performance they will need to be changed.
This article shows how to do that at the operating system level: Power-Saving in Windows Server 2008 R2 and later
Not Receiving Multicast Messages on a Microsoft Failover Cluster
It can happen that multicast messages are not received on a machine that is part of a Failover Cluster because the physical interface has a higher metric than the virtual failover adapter that is installed as part of Microsoft Failover Cluster.
This article explains how to diagnose the issue and adjust that metric of the physical interface so applications listening for incoming multicast messages are joined on the correct interface: The Case of Multicast Messages not being Received on a Windows Server 2008 R2 Microsoft Failover Cluster
Multicast Messages dropped because of a small Socket Receive Buffer
As messages travel from the wire through the NIC, the operating system network stack to your application, there are various buffers along the way that will need to be large enough to hold data for a little while in case one of the components involved is busy.
As an application developer, it is your job to make sure the receive buffer sizes used by the sockets listening for incoming multicast messages are large enough to buffer data e.g. when a garbage collection prevents your code from processing it for a moment.
Multicast Messages dropped because of the Base Filtering Engine
If there is a lot of multicast traffic on a machine, Windows’ Base Filtering Engine (BFE) might not be able to keep up with it, resulting in dramatic message loss. BFE is part of Windows Firewall, but it might be active even when a different firewall solution is used.
This article links to a hotfix available for Windows Server 2012 and also explains how to fix the issue in Windows Server 2012 R2 through the UdpExemptPortRange registry parameter: The Case of Multicast Message Loss on Windows Server 2012 R2
Multicast Messages dropped because of a small NIC Receive Buffer
Another reason for multicast message loss I experienced has been too small of a buffer on the receiving NIC. Everything was going smoothly until traffic was becoming a bit spiky. So even though the application socket receive buffer (see above) was large enough, data didn’t reach it because it was dropped in the network stack.
This article shows how to review NIC parameters with PowerShell (which unlike the NIC driver GUI in Windows does not require administrator access) and diagnose this kind of message drops: The Case of Multicast Message Loss on Windows Server 2012 R2 (again) It also contains some general tips on optimal NIC settings.
Multicast Message dropped because of the wrong Receive Side Scaling Load Balancing Profile
This article takes a look at the RSS Load Balancing Profile and how a driver update resetting it caused multicast message loss: The Case of Multicast Message Loss because of the wrong Receive Side Scaling Load Balancing Profile