Skip to content

Commit 12dd6e1

Browse files
authored
Merge pull request #2184 from pareenaverma/content_review
First tech review of java flamegraph LP, wrk2 architecture issue with…
2 parents ff5128b + 5139efa commit 12dd6e1

File tree

2 files changed

+38
-21
lines changed

2 files changed

+38
-21
lines changed

content/learning-paths/servers-and-cloud-computing/java-perf-flamegraph/1_setup.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,67 +9,85 @@ layout: learningpathall
99

1010
## Before You Begin
1111
- There are numerous performance analysis methods and tools for Java applications, among which the call stack flame graph method is regarded as a conventional entry-level approach. Therefore, generating flame graphs is considered a basic operation.
12-
- Various methods and tools are available for generating Java flame graphs, including async-profiler, Java Agent, jstack, JFR (Java Flight Recorder), etc.
13-
- This LP (Learning Path) focuses on introducing two simple and easy-to-use methods: async-profiler and Java Agent.
12+
- Various methods and tools are available for generating Java flame graphs, including `async-profiler`, `Java Agent`, `jstack`, `JFR` (Java Flight Recorder), etc.
13+
- This Learning Path focuses on introducing two simple and easy-to-use methods: `async-profiler` and `Java Agent`.
1414

1515

1616
## Setup Benchmark Server - Tomcat
1717
- [Apache Tomcat](https://tomcat.apache.org/) is an open-source Java Servlet container that enables running Java web applications, handling HTTP requests and serving dynamic content.
1818
- As a core component in Java web development, Apache Tomcat supports Servlet, JSP, and WebSocket technologies, providing a lightweight runtime environment for web apps.
1919

20-
1. So you should install Java Development Kit (JDK) first.
20+
1. Start by installing Java Development Kit (JDK) on your Arm-based server:
2121
```bash
2222
sudo apt update
2323
sudo apt install -y openjdk-21-jdk
2424
```
2525

26-
2. Second, you can install Tomcat by either [building it from source](https://github.com/apache/tomcat) or downloading the pre-built package simply from [the official website](https://tomcat.apache.org/whichversion.html)
26+
2. Next, you can install Tomcat by either [building it from source](https://github.com/apache/tomcat) or downloading the pre-built package simply from [the official website](https://tomcat.apache.org/whichversion.html)
2727
```bash
2828
wget -c https://dlcdn.apache.org/tomcat/tomcat-11/v11.0.9/bin/apache-tomcat-11.0.9.tar.gz
2929
tar xzf apache-tomcat-11.0.9.tar.gz
3030
```
3131

32-
3. If you intend to access the built-in Examples of Tomcat via an intranet IP or even an external IP, you need to modify a configuration file.
32+
3. If you intend to access the built-in examples of Tomcat via an intranet IP or even an external IP, you need to modify a configuration file as shown:
3333
```bash
3434
vim apache-tomcat-11.0.9/webapps/examples/META-INF/context.xml
35+
```
36+
Then change the values:
37+
```console
3538
# change <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
3639
# to
3740
# <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow=".*" />
38-
39-
# now you can start Tomcat Server
41+
```
42+
Now you can start Tomcat Server:
43+
```bash
4044
./apache-tomcat-11.0.9/bin/startup.sh
4145
```
4246

43-
4. If you can access the page at "http://${tomcat_ip}:8080/examples" via a browser, congratulations-you can proceed to the next benchmarking step.
47+
The output from starting the server should look like:
48+
49+
```output
50+
Using CATALINA_BASE: /home/ubuntu/apache-tomcat-11.0.9
51+
Using CATALINA_HOME: /home/ubuntu/apache-tomcat-11.0.9
52+
Using CATALINA_TMPDIR: /home/ubuntu/apache-tomcat-11.0.9/temp
53+
Using JRE_HOME: /usr
54+
Using CLASSPATH: /home/ubuntu/apache-tomcat-11.0.9/bin/bootstrap.jar:/home/ubuntu/apache-tomcat-11.0.9/bin/tomcat-juli.jar
55+
Using CATALINA_OPTS:
56+
Tomcat started.
57+
```
58+
59+
4. If you can access the page at "http://${tomcat_ip}:8080/examples" via a browser, you can proceed to the next benchmarking step.
4460

4561
![example image alt-text#center](./_images/lp-tomcat-homepage.png "Tomcat-HomePage")
4662

4763
![example image alt-text#center](./_images/lp-tomcat-examples.png "Tomcat-Examples")
4864

4965
## Setup Benchmark Client - [wrk2](https://github.com/giltene/wrk2)
50-
- wrk2 is a high-performance HTTP benchmarking tool specialized in generating constant throughput loads and measuring latency percentiles for web services.
51-
- As an enhanced version of wrk, wrk2 provides accurate latency statistics under controlled request rates, ideal for performance testing of HTTP servers.
66+
`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.
5267

53-
1. If you intend to use wrk2, you should install some essential tools before build it.
68+
1. To use `wrk2`, you will need to install some essential tools before you can build it:
5469
```bash
5570
sudo apt-get update
5671
sudo apt-get install -y build-essential libssl-dev git zlib1g-dev
5772
```
5873

59-
2. Now you can clone and build it from source.
74+
2. Now you can clone and build it from source:
6075
```bash
6176
sudo git clone https://github.com/giltene/wrk2.git
6277
cd wrk2
6378
sudo make
64-
# move the executable to somewhere in your PATH
79+
```
80+
Move the executable to somewhere in your PATH:
81+
```bash
6582
sudo cp wrk /usr/local/bin
6683
```
6784

6885
3. Finally, you can run the benchamrk of Tomcat through wrk2.
6986
```bash
7087
wrk -c32 -t16 -R50000 -d60 http://${tomcat_ip}:8080/examples/servlets/servlet/HelloWorldExample
7188
```
72-
Below is the output of wrk2
89+
Shown below is the output of wrk2:
90+
7391
```console
7492
Running 1m test @ http://172.26.203.139:8080/examples/servlets/servlet/HelloWorldExample
7593
16 threads and 32 connections

content/learning-paths/servers-and-cloud-computing/java-perf-flamegraph/_index.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Java Performance Analysis - FlameGraph
2+
title: Analyze Java Performance on Arm servers using FlameGraphs
33

44
draft: true
55
cascade:
66
draft: true
77

88
minutes_to_complete: 30
99

10-
who_is_this_for: This is an introductory guide for individuals aiming to perform performance analysis of Java applications on the ARM Neoverse platform using flame graphs.
10+
who_is_this_for: This is an introductory topic for software developers looking to analyze the performance of their Java applications on the Arm Neoverse based servers using flame graphs.
1111

1212
learning_objectives:
1313
- How to set up tomcat benchmark environment
@@ -17,13 +17,12 @@ learning_objectives:
1717
prerequisites:
1818
- Basic familiarity with Java applications
1919
- Basic familiarity with flame graphs
20-
- Basic familiarity with Tomcat, wrk, etc
2120

2221
author: Ying Yu, Martin Ma
2322

2423
### Tags
2524
skilllevels: Introductory
26-
subjects: Java Performance Analysis
25+
subjects: Performance and Architecture
2726
armips:
2827
- Neoverse
2928

@@ -34,13 +33,13 @@ tools_software_languages:
3433
- FlameGraph
3534
- wrk2
3635
operatingsystems:
37-
- Ubuntu 24
36+
- Linux
3837

3938

4039
further_reading:
4140
- resource:
42-
title: PLACEHOLDER MANUAL
43-
link: PLACEHOLDER MANUAL LINK
41+
title: OpenJDK Wiki
42+
link: https://wiki.openjdk.org/
4443
type: documentation
4544
- resource:
4645
title: PLACEHOLDER BLOG

0 commit comments

Comments
 (0)