Skip to content

Commit c83029d

Browse files
Content dev
1 parent 8685f09 commit c83029d

2 files changed

Lines changed: 83 additions & 66 deletions

File tree

Lines changed: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
---
2-
title: Tuning via NIC queue count
2+
title: Tune performance with NIC queue counts
33
weight: 4
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Tuning via NIC queue count
10-
To further optmize your settings, you can set the NIC queue count and observe the performance uplift:
9+
## Overview
1110

12-
Typically, the number of transmit/receive queues for network cards in bare-metal environments is relatively large, reaching 63 on Arm Neoverse. Each transmit/receive queue corresponds to one interrupt number. Before CPU cores are taken offline, there are sufficient cores to handle these interrupt numbers. However, when only 8 cores are retained, it results in a single core having to handle multiple interrupt numbers, thereby triggering more context switches.
11+
After establishing a baseline, you can further improve throughput and latency by tuning your network interface controller (NIC) queue count. Many baremetal NICs expose a relatively large number of transmit/receive queues (multi‑queue). Each queue maps to an interrupt; when you limit the server to a small number of online CPUs (for example, 8 cores), too many interrupts can land on the same core and increase context switching. Reducing the number of queues to match available CPUs can stabilize performance on Arm Neoverse systems.
1312

14-
### Setting NIC queue count
13+
## Set the NIC queue count
1514

16-
1. Use the following command to find the NIC name corresponding to he IP address.
15+
Use the following command to find the NIC name corresponding to the IP address:
1716
```bash
1817
ip addr
1918
```
20-
From the output you can see that the NIC name `enp1s0f0np0` corresponds to the IP address `10.169.226.181`.
19+
From the output you can see that the NIC name `enp1s0f0np0` corresponds to the IP address `10.169.226.181`:
2120
```output
2221
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
2322
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
@@ -33,12 +32,12 @@ From the output you can see that the NIC name `enp1s0f0np0` corresponds to the I
3332
valid_lft forever preferred_lft forever
3433
```
3534

36-
2. Set the network interface name variable
35+
Set the network interface name variable:
3736
```bash
3837
net=enp1s0f0np0
3938
```
4039

41-
3. Use the following command to check the current transmit/receive queues of the ${net} network interface
40+
Use the following command to check the current transmit/receive queues of the ${net} network interface:
4241
```bash
4342
sudo ethtool -l ${net}
4443
```
@@ -57,48 +56,56 @@ Other: n/a
5756
Combined: 32
5857
```
5958

60-
4. Use the following command to reset the number of transmit/receive queues for the ${net} to match the number of CPUs, which is 8.
61-
```bash
62-
sudo ethtool -L ${net} combined 8
63-
```
64-
5. Verify whether the settings have been successfully applied.
65-
```bash
66-
sudo ethtool -l ${net}
67-
```
68-
You should see that the number of combined Rx/Tx queues has been updated to 8.
69-
```output
70-
Channel parameters for enP11p4s0:
71-
Pre-set maximums:
72-
RX: n/a
73-
TX: n/a
74-
Other: n/a
75-
Combined: 32
76-
Current hardware settings:
77-
RX: n/a
78-
TX: n/a
79-
Other: n/a
80-
Combined: 8
81-
```
59+
Set the number of combined queues to match your online CPUs (example: 8):
60+
```bash
61+
sudo ethtool -L ${NET_IFACE} combined 8
62+
```
8263

83-
### The performance uplift after tuning NIC queue count
64+
Verify the change:
65+
```bash
66+
sudo ethtool -l ${NET_IFACE}
67+
```
8468

85-
1. Shutdown and restart `Tomcat` on your Arm Neoverse bare-metal instance as shown:
86-
```bash
87-
~/apache-tomcat-11.0.10/bin/shutdown.sh 2>/dev/null
88-
ulimit -n 65535 && ~/apache-tomcat-11.0.10/bin/startup.sh
89-
```
69+
You should see the `Combined` value updated to `8` under **Current hardware settings**:
70+
```output
71+
Channel parameters for enP11p4s0:
72+
Pre-set maximums:
73+
RX: n/a
74+
TX: n/a
75+
Other: n/a
76+
Combined: 32
77+
Current hardware settings:
78+
RX: n/a
79+
TX: n/a
80+
Other: n/a
81+
Combined: 8
82+
```
9083

91-
2. Run `wrk2` on your `x86_64` bare-metal instance:
92-
```bash
93-
ulimit -n 65535 && wrk -c1280 -t128 -R500000 -d60 http://${tomcat_ip}:8080/examples/servlets/servlet/HelloWorldExample
94-
```
84+
{{% notice Note %}}
85+
Queue settings applied with `ethtool -L` are not persistent across reboots. If needed, make the change persistent using a systemd unit or your distro’s NIC configuration mechanism.
86+
{{% /notice %}}
9587

96-
Notice the performance uplift after tuning the NIC queue count:
97-
```output
98-
Thread Stats Avg Stdev Max +/- Stdev
99-
Latency 8.35s 4.14s 16.33s 61.16%
100-
Req/Sec 2.96k 73.02 3.24k 89.16%
101-
22712999 requests in 1.00m, 11.78GB read
102-
Requests/sec: 378782.37
103-
Transfer/sec: 201.21MB
104-
```
88+
## Measure performance after tuning
89+
90+
Restart Tomcat on your Arm Neoverse bare‑metal instance:
91+
```bash
92+
~/apache-tomcat-11.0.10/bin/shutdown.sh 2>/dev/null
93+
ulimit -n 65535 && ~/apache-tomcat-11.0.10/bin/startup.sh
94+
```
95+
96+
Run `wrk2` from your `x86_64` bare‑metal client (replace `${tomcat_ip}` with your server IP):
97+
```bash
98+
ulimit -n 65535 && wrk -c1280 -t128 -R500000 -d60 http://${tomcat_ip}:8080/examples/servlets/servlet/HelloWorldExample
99+
```
100+
101+
Example results after tuning NIC queues:
102+
```output
103+
Thread Stats Avg Stdev Max +/- Stdev
104+
Latency 8.35s 4.14s 16.33s 61.16%
105+
Req/Sec 2.96k 73.02 3.24k 89.16%
106+
22712999 requests in 1.00m, 11.78GB read
107+
Requests/sec: 378782.37
108+
Transfer/sec: 201.21MB
109+
```
110+
111+
If performance improves and latency stabilizes, keep the adjusted queue count for subsequent tuning steps (RSS/RPS/XPS, IRQ affinity, and NUMA locality).

content/learning-paths/servers-and-cloud-computing/tune-network-workloads-on-bare-metal/4_local-numa.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ weight: 5
66
layout: learningpathall
77
---
88

9-
## Tuning via local (Non-Uniform Memory Access) NUMA
10-
In this section you will learn how to configure local NUMA and assess performance uplift acheieved through tuning.
9+
## Tune with local NUMA (Non-Uniform Memory Access)
1110

12-
Typically, cross-NUMA data transfers within the CPU incur higher latency than intra-NUMA transfers. Therefore, Tomcat should be deployed on the NUMA node where the network interface resides.
11+
In this section, you configure local NUMA and assess the performance uplift achieved through tuning. Cross‑NUMA data transfers generally incur higher latency than intraNUMA transfers, so Tomcat should be deployed on the NUMA node where the network interface resides to reduce cross‑node memory traffic and improve throughput and latency.
1312

14-
### Setting local NUMA
13+
### Configure local NUMA
14+
15+
Check NUMA topology and relative latencies:
1516

16-
1. Use the following command to check that the latency for cross-NUMA transfers is greater than the latency for intra-NUMA transfers:
1717
```bash
1818
numactl -H
1919
```
2020

21-
It can be observed that the cross-NUMA latency to intra-NUMA latency ratio is 10:100.
21+
You should see that cross‑NUMA latency is higher than intra‑NUMA latency (for example, 10:100):
22+
2223
```output
2324
available: 2 nodes (0-1)
2425
node 0 cpus: 0 1 2 3 4 5 6 7
@@ -33,28 +34,34 @@ node 0 1
3334
1: 100 10
3435
```
3536

36-
2. Use the following command to check the NUMA node where the ${net} network interface resides.
37+
Identify the NUMA node for your network interface (using the `${net}` variable defined earlier):
38+
3739
```bash
3840
cat /sys/class/net/${net}/device/numa_node
3941
```
40-
You will notice that the NUMA node where the ${net} network interface resides is 1.
42+
43+
Example output (NIC on NUMA node 1):
44+
4145
```output
4246
1
4347
```
4448

45-
3. As a result, allocate the reserved 8 cores to NUMA node 1.
49+
Allocate the eight reserved cores to the NIC’s NUMA node (the example below keeps CPUs 96–103 online on node 1 and offlines the rest):
50+
4651
```bash
4752
for no in {96..103}; do sudo bash -c "echo 1 > /sys/devices/system/cpu/cpu${no}/online"; done
4853
for no in {0..95} {104..191}; do sudo bash -c "echo 0 > /sys/devices/system/cpu/cpu${no}/online"; done
4954
```
5055

51-
4. Verify whether the settings have been successfully applied.
56+
Verify CPU online status and NUMA placement:
57+
5258
```bash
5359
lscpu
5460
```
5561

56-
From the output you will see that the only online CPUs are 72-79 on NUMA node 1.
57-
```bash
62+
You should see only CPUs 96–103 online on NUMA node 1:
63+
64+
```output
5865
Architecture: aarch64
5966
CPU op-mode(s): 64-bit
6067
Byte Order: Little Endian
@@ -71,20 +78,23 @@ NUMA:
7178
...
7279
```
7380

74-
### The result after tuning local NUMA
81+
### Validate performance after NUMA tuning
82+
83+
Restart Tomcat on the Arm Neoverse bare‑metal instance:
7584

76-
1. Shutdown and start Tomcat on the Arm Neoverse bare-metal instance:
7785
```bash
7886
~/apache-tomcat-11.0.10/bin/shutdown.sh 2>/dev/null
7987
ulimit -n 65535 && ~/apache-tomcat-11.0.10/bin/startup.sh
8088
```
8189

82-
2. Run `wrk2` on the `x86_64` bare-metal instance:
90+
Run `wrk2` on the `x86_64` bare‑metal client to measure throughput and latency:
91+
8392
```bash
8493
ulimit -n 65535 && wrk -c1280 -t128 -R500000 -d60 http://${tomcat_ip}:8080/examples/servlets/servlet/HelloWorldExample
8594
```
8695

87-
The result after configuring NUMA node should look like:
96+
Sample results after placing Tomcat on the NIC’s local NUMA node:
97+
8898
```output
8999
Thread Stats Avg Stdev Max +/- Stdev
90100
Latency 9.41s 4.71s 18.02s 61.07%

0 commit comments

Comments
 (0)