Skip to content

Commit 715c135

Browse files
authored
Merge pull request #2279 from madeline-underwood/tune_network_workloads
Tune network workloads_PV to sign off
2 parents 5525485 + eac2812 commit 715c135

File tree

7 files changed

+311
-246
lines changed

7 files changed

+311
-246
lines changed

content/learning-paths/servers-and-cloud-computing/tune-network-workloads-on-bare-metal/1_setup.md

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,64 @@ weight: 2
66
layout: learningpathall
77
---
88

9+
## Overview
910

10-
## Overview
11-
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-
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 bare metal instance. This Learning Path was tested on an AWS `c8g.metal-48xl` instance.
11+
Tomcat is a common client–server web workload that serves HTTP/HTTPS requests. In this section, you will set up a benchmarking environment using Apache Tomcat (server) and `wrk2` (client) to generate load and measure performance on an Arm-based bare‑metal instance. This Learning Path was validated on an AWS `c8g.metal‑48xl` instance running Ubuntu 24.04.
1512

1613
## Set up the Tomcat benchmark server
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.
14+
15+
[Apache Tomcat](https://tomcat.apache.org/) is an open‑source Java Servlet container for running Java web applications, handling HTTP requests, and serving dynamic content. It supports Servlet, JSP, and WebSocket.
1816

1917
## Install the Java Development Kit (JDK)
2018

21-
Install OpenJDK 21 on your Arm-based Ubuntu 24.04 bare-metal instance:
19+
Install OpenJDK 21 on your Armbased Ubuntu 24.04 baremetal instance:
2220

2321
```bash
2422
sudo apt update
2523
sudo apt install -y openjdk-21-jdk
2624
```
2725

28-
## Install Tomcat
26+
## Install Tomcat
2927

3028
Download and extract Tomcat:
3129

3230
```bash
3331
wget -c https://dlcdn.apache.org/tomcat/tomcat-11/v11.0.10/bin/apache-tomcat-11.0.10.tar.gz
3432
tar xzf apache-tomcat-11.0.10.tar.gz
3533
```
34+
3635
Alternatively, you can build Tomcat [from source](https://github.com/apache/tomcat).
3736

3837
## Enable access to Tomcat examples
3938

40-
To access the built-in examples from your local network or external IP, use a text editor to modify the `context.xml` file by updating the `RemoteAddrValve` configuration to allow all IP addresses.
39+
To access the built‑in examples from your local network or external IP, modify the `context.xml` file and update `RemoteAddrValve` to allow your clients.
40+
41+
The file is located at:
4142

42-
The file is at:
4343
```bash
4444
~/apache-tomcat-11.0.10/webapps/examples/META-INF/context.xml
4545
```
4646

47-
Replace the existing allow value as shown:
47+
Replace the existing value:
48+
4849
```xml
4950
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
5051
```
5152

5253
With:
54+
5355
```xml
5456
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow=".*" />
5557
```
56-
Save the changes to your file.
58+
59+
{{% notice Warning %}}
60+
Allowing `.*` permits access from all IP addresses and should be used only in isolated lab environments. Restrict this setting to trusted CIDR ranges for production or shared networks.
61+
{{% /notice %}}
5762

5863
## Start the Tomcat server
64+
5965
{{% notice Note %}}
60-
To achieve maximum performance of Tomcat, the maximum number of file descriptors that a single process can open simultaneously should be sufficiently large.
66+
For maximum performance, ensure the per‑process limit for open file descriptors is sufficient.
6167
{{% /notice %}}
6268

6369
Start the server:
@@ -66,7 +72,7 @@ Start the server:
6672
ulimit -n 65535 && ~/apache-tomcat-11.0.10/bin/startup.sh
6773
```
6874

69-
You should see output like:
75+
You should see output similar to:
7076

7177
```output
7278
Using CATALINA_BASE: /home/ubuntu/apache-tomcat-11.0.10
@@ -80,24 +86,30 @@ Tomcat started.
8086

8187
## Confirm server access
8288

83-
In your browser, open: `http://${tomcat_ip}:8080/examples`.
89+
Replace `${tomcat_ip}` with the public or private IP address of your Arm server and open:
90+
91+
```
92+
http://${tomcat_ip}:8080/examples
93+
```
8494

8595
You should see the Tomcat welcome page and examples, as shown below:
8696

87-
![Screenshot of the Tomcat homepage showing version and welcome panel alt-text#center](./_images/lp-tomcat-homepage.png "Apache Tomcat homepage")
97+
![Screenshot of the Apache Tomcat homepage showing version and welcome panel alt-text#center](./_images/lp-tomcat-homepage.png "Apache Tomcat homepage")
8898

8999
![Screenshot of the Tomcat examples page showing servlet and JSP demo links alt-text#center](./_images/lp-tomcat-examples.png "Apache Tomcat examples")
90100

91-
{{% notice Note %}}Make sure port 8080 is open in the security group of the IP address for your Arm-based Linux machine.{{% /notice%}}
101+
{{% notice Note %}}
102+
Ensure port **8080** is open in the security group or firewall for your Arm‑based Linux machine.
103+
{{% /notice %}}
92104

93105
## Set up the benchmarking client using wrk2
94106
[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.
95107

96108
{{% notice Note %}}
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
109+
Currently, `wrk2` is only supported on x86_64 machines. Run the client steps below on a baremetal x86_64 server running Ubuntu 24.04.
98110
{{% /notice %}}
99111

100-
## Install dependencies
112+
## Install dependencies
101113

102114
Install the required packages:
103115

@@ -111,27 +123,36 @@ sudo apt-get install -y build-essential libssl-dev git zlib1g-dev
111123
Clone the repository and compile the tool:
112124

113125
```bash
114-
sudo git clone https://github.com/giltene/wrk2.git
126+
git clone https://github.com/giltene/wrk2.git
115127
cd wrk2
116-
sudo make
128+
make
117129
```
118130

119-
Move the binary to a directory in your system’s PATH:
120-
131+
Move the binary to a directory in your system’s `PATH`:
132+
121133
```bash
122134
sudo cp wrk /usr/local/bin
123135
```
124136

125137
## Run the benchmark
138+
126139
{{% notice Note %}}
127-
To achieve maximum performance of wrk2, the maximum number of file descriptors that a single process can open simultaneously should be sufficiently large.
140+
As with Tomcat, set a high open‑files limit to avoid hitting FD caps during the run.
128141
{{% /notice %}}
129142

130-
Use the following command to benchmark the HelloWorld servlet running on Tomcat:
143+
Benchmark the `HelloWorld` servlet running on Tomcat:
131144

132145
```bash
133146
ulimit -n 65535 && wrk -c32 -t16 -R50000 -d60 http://${tomcat_ip}:8080/examples/servlets/servlet/HelloWorldExample
134147
```
148+
149+
**Flags explained:**
150+
151+
- `-c32` — 32 open connections
152+
- `-t16` — 16 threads
153+
- `-R50000` — constant 50,000 requests/second
154+
- `-d60` — run for 60 seconds
155+
135156
You should see output similar to:
136157

137158
```console

0 commit comments

Comments
 (0)