You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/tune-network-workloads-on-bare-metal/1_setup.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Tomcat benchmark set up
2
+
title: Set up Tomcat
3
3
weight: 2
4
4
5
5
### FIXED, DO NOT MODIFY
@@ -9,16 +9,16 @@ layout: learningpathall
9
9
10
10
## Overview
11
11
12
-
There are numerouse client-server and network-based workloads, and Tomcat is a typical example of such applications, which provide services via HTTP/HTTPS network requests.
12
+
There are numerous client-server and network-based workloads, with Tomcat being a typical example of such applications. Tomcat provides services via HTTP/HTTPS network requests.
13
13
14
-
In this section, you'll set up a benchmark environment using `Apache Tomcat` and `wrk2` to simulate HTTP load and evaluate performance on an Arm-based bare-metal, such as **__`AWS c8g.metal-48xl`__**.
14
+
In this section, you will set up a benchmark environment using `Apache Tomcat` and `wrk2` to simulate an HTTP load and evaluate performance on an Arm-based baremetal instance. This Learning Path was tested on an AWS `c8g.metal-48xl` instance.
15
15
16
-
## Set up the Tomcat benchmark server on **AWS c8g.metal-48xl**
16
+
## Set up the Tomcat benchmark server
17
17
[Apache Tomcat](https://tomcat.apache.org/) is an open-source Java Servlet container that runs Java web applications, handles HTTP requests, and serves dynamic content. It supports technologies such as Servlet, JSP, and WebSocket.
18
18
19
19
## Install the Java Development Kit (JDK)
20
20
21
-
Install OpenJDK 21 on your Arm-based Ubuntu 24 bare-metal:
21
+
Install OpenJDK 21 on your Arm-based Ubuntu 24.04 bare-metal instance:
@@ -91,7 +94,7 @@ You should see the Tomcat welcome page and examples, as shown below:
91
94
[Wrk2](https://github.com/giltene/wrk2) is a high-performance HTTP benchmarking tool specialized in generating constant throughput loads and measuring latency percentiles for web services. `wrk2` is an enhanced version of `wrk` that provides accurate latency statistics under controlled request rates, ideal for performance testing of HTTP servers.
92
95
93
96
{{% notice Note %}}
94
-
Currently `wrk2` is only supported on x86 machines. Run the benchmark client steps below on an `x86_64` server running Ubuntu 24.
97
+
Currently `wrk2` is only supported on x86 machines. Run the benchmark client steps below on a bare metal `x86_64` server running Ubuntu 24.04
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/tune-network-workloads-on-bare-metal/2_baseline.md
+44-39Lines changed: 44 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Optimal baseline before tuning
2
+
title: Establish baseline performance
3
3
weight: 3
4
4
5
5
### FIXED, DO NOT MODIFY
@@ -11,59 +11,59 @@ To achieve maximum performance, ulimit -n 65535 must be executed on both server
11
11
{{% /notice %}}
12
12
13
13
## Optimal baseline before tuning
14
-
- Align the IOMMU settings with default Ubuntu
14
+
- Align the IOMMU settings with default Ubuntu settings
15
15
- Baseline on Arm Neoverse bare-metal (default configuration)
16
16
- Baseline on Arm Neoverse bare-metal (access logging disabled)
17
17
- Baseline on Arm Neoverse bare-metal (optimal thread count)
18
18
19
-
### Align the IOMMU settings with default Ubuntu
19
+
### Align the IOMMU settings with default Ubuntu settings
20
20
21
21
{{% notice Note %}}
22
-
Due to the customized Ubuntu distribution on AWS, you first need to align the IOMMU settings with default Ubuntu: iommu.strict=1 and iommu.passthrough=0.
22
+
As you are using a custom Ubuntu distribution on AWS, you will first need to align the IOMMU settings with default Ubuntu settings for IOMMU: iommu.strict=1 and iommu.passthrough=0.
23
23
{{% /notice %}}
24
24
25
-
1.Setting IOMMU default status, use a text editor to modify the `grub` file by adding or updating the `GRUB_CMDLINE_LINUX` configuration.
25
+
1.To change the IOMMU settings, use a text editor to modify the `grub` file by adding or updating the `GRUB_CMDLINE_LINUX` configuration:
26
26
27
27
```bash
28
28
sudo vi /etc/default/grub
29
29
```
30
-
then add or update
30
+
Depending on what's in your `grub` file you will need to add or update`GRUB_CMDLINE_LINUX`:
### Baseline on Arm Neoverse bare-metal (default configuration)
51
+
### Establish a baseline configuration on Arm Neoverse bare-metal instances
52
52
53
53
{{% notice Note %}}
54
-
To align with the typical deployment scenario of Tomcat, reserve 8 cores online and set all other cores offline
54
+
To align with typical deployment scenario of Tomcat, you will need to reserve 8 cores on your instance to be online and set all other cores to be offline
55
55
{{% /notice %}}
56
56
57
-
1.You can offline the CPU cores using the below command.
57
+
1.To set the remaining CPU cores on your instance to be offline, run:
Replace `{tomcat_ip}` in the command above with the IP address of your Arm-based instance where the Tomcat server is running.
91
90
92
-
The result of default configuration is:
93
-
```bash
91
+
The result with this baseline configuration should look like:
92
+
```output
94
93
Thread Stats Avg Stdev Max +/- Stdev
95
94
Latency 16.76s 6.59s 27.56s 56.98%
96
95
Req/Sec 1.97k 165.05 2.33k 89.90%
@@ -100,15 +99,15 @@ Requests/sec: 244449.62
100
99
Transfer/sec: 129.90MB
101
100
```
102
101
103
-
### Baseline on Arm Neoverse bare-metal (access logging disabled)
104
-
To disable the access logging, use a text editor to modify the `server.xml` file by commenting out or removing the **`org.apache.catalina.valves.AccessLogValve`** configuration.
102
+
### Disable Access logging
103
+
To disable access logging, use a text editor to modify the `server.xml` file by commenting out or removing the **`org.apache.catalina.valves.AccessLogValve`** configuration.
105
104
106
105
The file is at:
107
106
```bash
108
107
vi ~/apache-tomcat-11.0.10/conf/server.xml
109
108
```
110
109
111
-
The configuratin is at the end of the file, and common out or remove it.
110
+
Either comment out or delete the configuration shown at the end of the file:
The result with access logging disabled should look like:
132
131
```bash
133
132
Thread Stats Avg Stdev Max +/- Stdev
134
133
Latency 16.16s 6.45s 28.26s 57.85%
@@ -139,15 +138,15 @@ Requests/sec: 271675.12
139
138
Transfer/sec: 144.36MB
140
139
```
141
140
142
-
### Baseline on Arm Neoverse bare-metal (optimal thread count)
141
+
### Set up optimal thread counts
143
142
To minimize resource contention between threads and overhead from thread context switching, the number of CPU-intensive threads in Tomcat should be aligned with the number of CPU cores.
144
143
145
-
1. When using `wrk` to perform pressure testing on `Tomcat`:
144
+
1. When using `wrk` to perform pressure testing on `Tomcat`, use `top` to identify the CPU-intensive threads :
146
145
```bash
147
146
top -H -p$(pgrep java)
148
147
```
149
148
150
-
You can see the below information
149
+
The output from `top` will look like:
151
150
```bash
152
151
top - 08:57:29 up 20 min, 1 user, load average: 4.17, 2.35, 1.22
It can be observed that **`http-nio-8080-e`** and **`http-nio-8080-P`** threads are CPU-intensive.
188
-
Since the __`http-nio-8080-P`__ thread is fixed at 1 in current version of Tomcat, and the current number of CPU cores is 8, the http-nio-8080-e thread count should be configured to 7.
186
+
You can observe from the output that **`http-nio-8080-e`** and **`http-nio-8080-P`** threads are CPU-intensive.
187
+
As the __`http-nio-8080-P`__ thread is fixed at 1 in current version of Tomcat, and the current number of CPU cores is 8, the `http-nio-8080-e` thread count should be configured to 7.
189
188
190
-
To configure the `http-nio-8080-e` thread count, use a text editor to modify the `context.xml` file by updating the `<Connector port="8080" protocol="HTTP/1.1"` configuration.
189
+
To configure the `http-nio-8080-e` thread count, use a text editor to modify the `server.xml` file and update the `<Connector port="8080" protocol="HTTP/1.1"` configuration.
191
190
192
191
The file is at:
193
192
```bash
194
193
vi ~/apache-tomcat-11.0.10/conf/server.xml
195
194
```
196
195
197
-
196
+
Replace the existing Connector setting as shown:
198
197
```xml
199
198
<!-- Before -->
200
199
<Connectorport="8080"protocol="HTTP/1.1"
201
200
connectionTimeout="20000"
202
201
redirectPort="8443" />
203
202
```
204
203
204
+
With the updated setting:
205
+
205
206
```xml
206
207
<!-- After -->
207
208
<Connectorport="8080"protocol="HTTP/1.1"
@@ -214,23 +215,27 @@ vi ~/apache-tomcat-11.0.10/conf/server.xml
214
215
/>
215
216
```
216
217
217
-
2. Use the following command on the Arm Neoverse bare-metal where `Tomcat` is on
218
+
Save the changes to `server.xml`.
219
+
220
+
2. Now shutdown and restart `Tomcat` on your Arm Neoverse bare-metal instance as shown:
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/tune-network-workloads-on-bare-metal/3_nic-queue.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,7 @@ layout: learningpathall
7
7
---
8
8
9
9
## Tuning via NIC queue count
10
-
- Setting NIC queue count
11
-
- The result after tuning NIC queue count
10
+
To further optmize your settings, you can set the NIC queue count and observe the performance uplift:
12
11
13
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.
14
13
@@ -18,8 +17,8 @@ Typically, the number of transmit/receive queues for network cards in bare-metal
18
17
```bash
19
18
ip addr
20
19
```
21
-
It can be observed that the NIC name `enp1s0f0np0`corresponsed to the IP address `10.169.226.181`.
22
-
```bash
20
+
From the output you can see that the NIC name `enp1s0f0np0`corresponds to the IP address `10.169.226.181`.
21
+
```output
23
22
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
0 commit comments