<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
The first step is to benchmark with iperf or something similar. 160K packets per second is a fairly stiff load. It’s often not so much
<div class="">the bandwidth in these cases as the time necessary for the OS to process the packet. If a new packet comes in before</div>
<div class="">the OS has finished processing the old one it will quickly go into a death spiral. That’s the typical profile for</div>
<div class="">UDP at max load; it will be going along fine, then as load increases it will drop a few packets, then drop</div>
<div class="">off a cliff. Take a look at CPU load while under load. With modern CPUs you probably won’t max out CPU</div>
<div class="">when receiving a lot of packets but you should see it go up.</div>
<div class=""><br class="">
</div>
<div class="">You might also monkey with the UDP buffer size, particularly if you’ve got a fast network. If you’re on</div>
<div class="">a 10GB network I’d probably set to to 2 MB.</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php" class="">https://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php</a></div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class=""><br class="">
</div>
<div class="">I am on linux 64 bit, so I had a coworker write his own version of this test using Visual Studio 2013 on Windows (no code sharing), and he saw the same behavior:  c# async suffering massive packet loss while c# sync is keeping up easily.<br class="">
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>