We have a UDP server that accepts many connections. In Win2k3 it can talk to anywhere from 90K to 120K IP addresses with no problem.
On Win2k8R2 it throttles and often tips over at 30K users.
I have xperf logs showing the problems. DPCs start out taking reasonable amounts of time, but eventually grow to take half a second upwards of 3/4 of a second; at that point the network stack seems to tip over and start again.
I've appended some of the xperf data. I don't see a way to provide an attachment.
The nic is the Intel 82576 with only one link active. Again - same code same hardware runs fine on win2k3.
There are various routes to it, but huge swaths of code always end up in: NDIS.SYS!NdisAcquireReadWriteLock.
I would assume on the same lock, and I would guess it's a spin lock since it spends all its time in ntkrnlmp.exe!KeAcquireSpinLockAtDpcLevel.
In our sample the process had a weight of 540,714 units. Of that at least 210,597 ended up trying to acquire that lock via WSASendTo. Gory details appended.
From the DPC view, you can see the calls that were taking 1/2 a second or longer. There are 110 of them in a 37 second sample. The time to process varies randomly and there are many thousands in between. This is appended as the second set of voluminous data.
OS is Win2k R2 SP1
The Intel 82576 NIC has the latest available drivers
I've already tried altering just about every network parameter to observe the results. RSS enabled/disabled. RSS NIC configured for 1 or more CPUs. Various timings for Interrupt deferral, etc...
The net effect of all this was that I could move the shape of the curves, and even stop the network from tipping over entirely; however the DPC times are still awful; the spinlocks are still spinning and the net throughput is still 1/4 of Win2k3.
Any suggestions? What's the next step?
Joe
| Stack | Weight | % Weight | Count |
| | | | | | |- ws2_32.dll!WSASendTo | 210597.1896 | 5.33 | 210735 |
| | | | | | | |- mswsock.dll!WSPSendTo | 210222.4585 | 5.32 | 210356 |
| | | | | | | | |- ntdll.dll!ZwDeviceIoControlFile | 209948.2971 | 5.31 | 210079 |
| | | | | | | | | ntdll.dll!LdrInitializeThunk | 209948.2971 | 5.31 | 210079 |
| | | | | | | | | ntdll.dll! ?? ::FNODOBFM::`string' | 209948.2971 | 5.31 | 210079 |
| | | | | | | | | wow64.dll!Wow64LdrpInitialize | 209948.2971 | 5.31 | 210079 |
| | | | | | | | | wow64.dll!RunCpuSimulation | 209948.2971 | 5.31 | 210079 |
| | | | | | | | | wow64cpu.dll!DeviceIoctlFileFault | 209948.2971 | 5.31 | 210079 |
| | | | | | | | | wow64cpu.dll!CpupSyscallStub | 209948.2971 | 5.31 | 210079 |
| | | | | | | | | |- ntkrnlmp.exe!KiSystemServiceCopyEnd | 209865.9437 | 5.31 | 209996 |
| | | | | | | | | | |- ntkrnlmp.exe!NtDeviceIoControlFile | 209861.9414 | 5.31 | 209992 |
| | | | | | | | | | | |- ntkrnlmp.exe!IopXxxControlFile | 209856.0089 | 5.31 | 209986 |
| | | | | | | | | | | | |- afd.sys!AfdFastIoDeviceControl | 209456.9132 | 5.3 | 209583 |
| | | | | | | | | | | | | |- afd.sys!AfdFastDatagramSend | 209323.6618 | 5.3 | 209448 |
| | | | | | | | | | | | | | |- afd.sys!AfdTLFastDgramSend | 208405.7464 | 5.27 | 208521 |
| | | | | | | | | | | | | | | |- tcpip.sys!UdpTlProviderSendMessages | 208270.0504 | 5.27 | 208384 |
| | | | | | | | | | | | | | | | |- ntkrnlmp.exe!KeExpandKernelStackAndCalloutEx | 208216.8802 | 5.27 | 208330 |
| | | | | | | | | | | | | | | | | |- tcpip.sys!UdpTlProviderSendMessagesCalloutRoutine | 208164.7757 | 5.27 | 208277 |
| | | | | | | | | | | | | | | | | | |- tcpip.sys!UdpSendMessages | 208158.8001 | 5.27 | 208271 |
| | | | | | | | | | | | | | | | | | | |- tcpip.sys!UdpSendMessagesOnPathCreation | 204713.1138 | 5.18 | 204823 |
| | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpAleFastUdpInspection | 127845.6429 | 3.23 | 127912 |
| | | | | | | | | | | | | | | | | | | | | |- NDIS.SYS!NdisAcquireReadWriteLock | 127041.047 | 3.21 | 127099 |
| | | | | | | | | | | | | | | | | | | | | |- ntkrnlmp.exe!RtlLookupEntryHashTable | 264.272245 | 0.01 | 267 |
| | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpAleFastUdpInspection<itself> | 171.42808 | 0 | 173 |
| | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpAlepIsSameEndpoint | 131.641229 | 0 | 133 |
| | | | | | | | | | | | | | | | | | | | | |- netio.sys!WfpRefreshEntryLru | 125.181435 | 0 | 126 |
| | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!memset | 39.508324 | 0 | 40 |
| | | | | | | | | | | | | | | | | | | | | |- netio.sys!KfdIsLayerEmpty | 30.500205 | 0 | 31 |
| | | | | | | | | | | | | | | | | | | | | |- netio.sys!KfdGetLayerCacheEpoch | 18.334937 | 0 | 19 |
| | | | | | | | | | | | | | | | | | | | | |- NDIS.SYS!NdisReleaseReadWriteLock | 15.799406 | 0 | 16 |
| | | | | | | | | | | | | | | | | | | | | |- ntkrnlmp.exe! ?? ::FNODOBFM::`string' | 3.992942 | 0 | 4 |
| | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!KfdIsLayerEmpty | 3.937052 | 0 | 4 |
| | | | | | | | | | | | | | | | | | | | |- tcpip.sys!IpNlpFastSendDatagram | 63245.49252 | 1.6 | 63271 |
| | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!IppSendDatagramsCommon | 62205.09904 | 1.57 | 62216 |
| | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpProcessOutTransportStackIndication | 61667.95687 | 1.56 | 61676 |
| | | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!ProcessALEForTransportPacket | 61615.13818 | 1.56 | 61623 |
| | | | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpAleMatchStatefulEndpoint | 50338.28726 | 1.27 | 50346 |
| | | | | | | | | | | | | | | | | | | | | | | | | |- NDIS.SYS!NdisAcquireReadWriteLock | 50260.6444 | 1.27 | 50268 |
| | | | | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpAleMatchStatefulEndpoint<itself> | 31.797626 | 0 | 32 |
| | | | | | | | | | | | | | | | | | | | | | | | | |- ntkrnlmp.exe!RtlLookupEntryHashTable | 20.90588 | 0 | 21 |
| | | | | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpAlepIsSameEndpoint | 8.997452 | 0 | 9 |
| | | | | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!memset | 8.940707 | 0 | 9 |
| | | | | | | | | | | | | | | | | | | | | | | | | |- netio.sys!WfpRefreshEntryLru | 2.999293 | 0 | 3 |
| | | | | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!_security_check_cookie | 2.001804 | 0 | 2 |
| | | | | | | | | | | | | | | | | | | | | | | | | |- NDIS.SYS!NdisReleaseReadWriteLock | 2.000098 | 0 | 2 |
| | | | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpAleConnectAcceptIndicate | 11225.06641 | 0.28 | 11225 |
| | | | | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpAleAuthorizeSend | 11219.07252 | 0.28 | 11219 |
| | | | | | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpAlepAuthorizeSend | 11208.09459 | 0.28 | 11208 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | |- tcpip.sys!WfpAleInsertRemoteEndpoint | 11035.14208 | 0.28 | 11035 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | |- NDIS.SYS!NdisAcquireReadWriteLock | 10873.02754 | 0.28 | 10873 |
DPC Raw Info:
| Function | Count | Max Actual Duration (ms) |
| ndisInterruptDpc | 554751 | 713.847 |
| 1 | 713.847 | |
| 1 | 708.4239 | |
| 1 | 677.1281 | |
| 1 | 672.813 | |
| 1 | 672.2575 | |
| 1 | 660.812 | |
| 1 | 660.0321 | |
| 1 | 655.2213 | |
| 1 | 647.1885 | |
| 1 | 641.3311 | |
| 1 | 632.4002 | |
| 1 | 622.6813 | |
| 1 | 621.7657 | |
| 1 | 620.5844 | |
| 1 | 617.5036 | |
| 1 | 615.4015 | |
| 1 | 610.9474 | |
| 1 | 606.8938 | |
| 1 | 604.7577 | |
| 1 | 594.5486 | |
| 1 | 587.6109 | |
| 1 | 581.5086 | |
| 1 | 580.0222 | |
| 1 | 579.7739 | |
| 1 | 576.6219 | |
| 1 | 576.4333 | |
| 1 | 575.1572 | |
| 1 | 574.4537 | |
| 1 | 574.1743 | |
| 1 | 573.7621 | |
| 1 | 560.8745 | |
| 1 | 559.7798 | |
| 1 | 557.8415 | |
| 1 | 557.8143 | |
| 1 | 557.5373 | |
| 1 | 553.3025 | |
| 1 | 553.172 | |
| 1 | 550.6415 | |
| 1 | 549.8416 | |
| 1 | 549.612 | |
| 1 | 549.5203 | |
| 1 | 548.3752 | |
| 1 | 548.0821 | |
| 1 | 547.8116 | |
| 1 | 547.4588 | |
| 1 | 547.2672 | |
| 1 | 545.9869 | |
| 1 | 544.6088 | |
| 1 | 544.3772 | |
| 1 | 542.6019 | |
| 1 | 542.4782 | |
| 1 | 542.2717 | |
| 1 | 542.2666 | |
| 1 | 542.2051 | |
| 1 | 540.3364 | |
| 1 | 538.9678 | |
| 1 | 538.8142 | |
| 1 | 538.3009 | |
| 1 | 537.85 | |
| 1 | 535.7837 | |
| 1 | 534.7581 | |
| 1 | 534.7572 | |
| 1 | 532.4798 | |
| 1 | 532.2034 | |
| 1 | 532.0741 | |
| 1 | 531.8791 | |
| 1 | 530.7899 | |
| 1 | 529.894 | |
| 1 | 528.7522 | |
| 1 | 527.006 | |
| 1 | 526.6041 | |
| 1 | 526.3972 | |
| 1 | 525.4709 | |
| 1 | 525.351 | |
| 1 | 524.2444 | |
| 1 | 522.7439 | |
| 1 | 521.5258 | |
| 1 | 520.562 | |
| 1 | 520.4451 | |
| 1 | 518.5009 | |
| 1 | 517.4765 | |
| 1 | 517.375 | |
| 1 | 517.282 | |
| 1 | 512.0087 | |
| 1 | 511.5543 | |
| 1 | 511.5373 | |
| 1 | 510.6021 | |
| 1 | 509.3328 | |
| 1 | 508.7159 | |
| 1 | 507.1279 | |
| 1 | 505.7661 | |
| 1 | 505.1325 | |
| 1 | 504.612 | |
| 1 | 501.9754 | |
| 1 | 501.9476 | |
| 1 | 501.94 | |
| 1 | 500.7436 | |
| 1 | 500.625 | |
| 1 | 500.5376 | |
| 1 | 499.567 | |
| 1 | 499.5614 | |
| 1 | 499.36 | |
| 1 | 499.2837 | |
| 1 | 499.0861 | |
| 1 | 499.0537 | |
| 1 | 498.7743 | |
| 1 | 498.4466 | |
| 1 | 498.3967 | |
| 1 | 496.5591 | |
| 1 | 495.4409 |
Joe Rohde