Building Scalable Apps Using NetXtreme Network Suite for .NET

Written by

in

Optimizing .NET applications using Broadcom NetXtreme Network Suites involves shifting heavy TCP/IP protocol processing away from the host CPU directly into the network interface card (NIC) hardware. When building enterprise .NET software (such as ASP.NET Core web APIs or microservices), network I/O serialization, packet validation, and connection management can quickly become a bottleneck. Utilizing NetXtreme’s advanced hardware capabilities prevents high CPU consumption, maximizing the performance and throughput of the .NET runtime.

The critical hardware offloads, driver configurations, and application considerations necessary to optimize a .NET environment with NetXtreme network controllers include the following: 1. Enable Hardware Offloading Capabilities

By default, the Windows TCP/IP stack processes network traffic on the server’s CPU cores. NetXtreme adapters mitigate this by handling packets natively:

TCP Offload Engine (TOE): Handles up to 1,880 concurrent connection states directly on 10-Gbps adapters. This preserves system CPU resources specifically for .NET garbage collection (GC) and code execution.

Large Send Offload (LSO) & Checksum Offload: Offloads IP/TCP/UDP packet validation and chunking to the NIC. This reduces the context-switching overhead often triggered during high-volume .NET HTTP/gRPC transfers.

iSCSI Offload: Speeds up block-level data communication if your .NET application interacts directly with storage area networks (SANs). 2. Configure Core Network Adapter Settings

To apply these optimizations, open the Windows Device Manager, navigate to Network adapters, right-click your Broadcom NetXtreme device, choose Properties, and navigate to the Advanced tab:

Receive Side Scaling (RSS): Enable this to distribute network packet processing across multiple CPU cores. Align your RSS queue count with the physical core topology of your server to keep .NET thread pool contention low.

Jumbo Frames: Set this to Enabled (e.g., 9000 MTU) if your application transfers large data payloads over a local data center or LAN. This greatly minimizes packet overhead and CPU cycles per byte.

Flow Control: Set this to Rx & Tx Enabled. This lets the NetXtreme hardware manage data flow buffers rather than forcing the Windows OS to pause execution.

Buffers Allocation: Increase Receive Buffers and Transmit Buffers to their maximum supported values (e.g., doubling transmission boundaries) to prevent dropped packets during massive traffic spikes.

Energy Efficient Ethernet (EEE): Set this to Disabled. Power-saving features introduce micro-latencies when the card transitions out of low-power states, which degrades real-time .NET APIs. 3. Align the .NET Code Implementation

The underlying software design must complement the high-performance capabilities of the NetXtreme hardware layer:

Asynchronous I/O: Use async network calls exclusively (HttpClient.SendAsync, Stream.ReadAsync). This frees up .NET worker threads while the physical NetXtreme card processes incoming or outgoing buffers.

ArrayPool and Memory: Implement System.Buffers.ArrayPool to reuse byte arrays. This allows the network hardware to fill memory buffers directly without triggering frequent .NET Garbage Collection cycles.

SocketsHttpHandler Tuning: Adjust the connection pool limits and idle timeouts on your SocketsHttpHandler instances to keep underlying TCP connections warm, taking full advantage of the NIC’s active connection offloads. To get the best configuration results, tell me: What version of .NET are you developing on?

Is this application processing millions of micro-requests (low latency) or transferring massive file streams (high throughput)?

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *