Skip to content

Commit c6f2240

Browse files
authored
Merge pull request #2427 from odidev/flink_LP
Deploy Apache Flink on Google Cloud C4A (Arm-based Axion VMs)
2 parents 50b372d + 7416aa5 commit c6f2240

File tree

10 files changed

+415
-0
lines changed

10 files changed

+415
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Deploy Apache Flink on Google Cloud C4A (Arm-based Axion VMs)
3+
4+
draft: true
5+
cascade:
6+
draft: true
7+
8+
minutes_to_complete: 30
9+
10+
who_is_this_for: This learning path is intended for software developers deploying and optimizing Apache Flink workloads on Linux/Arm64 environments, specifically using Google Cloud C4A virtual machines powered by Axion processors.
11+
12+
learning_objectives:
13+
- Provision an Arm-based SUSE SLES virtual machine on Google Cloud (C4A with Axion processors)
14+
- Install Apache Flink on a SUSE Arm64 (C4A) instance
15+
- Validate Flink functionality by starting the Flink cluster and running a simple baseline job (e.g., WordCount) on the Arm64 VM
16+
- Benchmark Flink performance using internal JMH-based micro-benchmarks on Arm64 (Aarch64) architecture
17+
18+
prerequisites:
19+
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
20+
- Basic familiarity with [Apache Flink](https://flink.apache.org/) and its runtime environment
21+
22+
author: Pareena Verma
23+
24+
##### Tags
25+
skilllevels: Introductory
26+
subjects: Databases
27+
cloud_service_providers: Google Cloud
28+
29+
armips:
30+
- Neoverse
31+
32+
tools_software_languages:
33+
- Flink
34+
- Java
35+
- Maven
36+
37+
operatingsystems:
38+
- Linux
39+
40+
# ================================================================================
41+
# FIXED, DO NOT MODIFY
42+
# ================================================================================
43+
further_reading:
44+
- resource:
45+
title: Google Cloud documentation
46+
link: https://cloud.google.com/docs
47+
type: documentation
48+
49+
- resource:
50+
title: Flink documentation
51+
link: https://nightlies.apache.org/flink/flink-docs-lts/
52+
type: documentation
53+
54+
- resource:
55+
title: Flink Performance Tool
56+
link: https://github.com/apache/flink-benchmarks/tree/master?tab=readme-ov-file#flink-benchmarks
57+
type: documentation
58+
59+
weight: 1
60+
layout: "learningpathall"
61+
learning_path_main_page: "yes"
62+
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# ================================================================================
3+
# FIXED, DO NOT MODIFY THIS FILE
4+
# ================================================================================
5+
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
6+
title: "Next Steps" # Always the same, html page title.
7+
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
8+
---
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Getting started with Apache Flink on Google Axion C4A (Arm Neoverse-V2)
3+
4+
weight: 2
5+
6+
layout: "learningpathall"
7+
---
8+
9+
## Google Axion C4A Arm instances in Google Cloud
10+
11+
Google Axion C4A is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm Neoverse-V2 cores. Designed for high-performance and energy-efficient computing, these virtual machines offer strong performance for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.
12+
13+
The C4A series provides a cost-effective alternative to x86 virtual machines while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.
14+
15+
To learn more about Google Axion, refer to the [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu) blog.
16+
17+
## Apache Flink
18+
19+
[Apache Flink](https://flink.apache.org/) is an open-source, distributed **stream and batch data processing framework** developed under the [Apache Software Foundation](https://www.apache.org/).
20+
21+
Flink is designed for **high-performance, low-latency, and stateful computations** on both unbounded (streaming) and bounded (batch) data. It provides a robust runtime and APIs in **Java**, **Scala**, and **Python** for building scalable, fault-tolerant data processing pipelines.
22+
23+
Flink is widely used for **real-time analytics**, **event-driven applications**, **data pipelines**, and **machine learning workloads**. It integrates seamlessly with popular systems such as **Apache Kafka**, **Hadoop**, and various **cloud storage services**.
24+
25+
To learn more, visit the [Apache Flink official website](https://flink.apache.org/) and explore the [documentation](https://nightlies.apache.org/flink/flink-docs-release-2.1/).
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
title: Apache Flink Baseline Testing on Google Axion C4A Arm Virtual Machine
3+
weight: 5
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Apache Flink Baseline Testing on GCP SUSE VM
10+
This guide explains how to perform **baseline testing** for Apache Flink after installation on a **GCP SUSE VM**. Baseline testing ensures that the Flink cluster is operational, the environment is correctly configured, and basic jobs run successfully.
11+
12+
### Download and Extract Maven
13+
Before running Flink jobs, ensure that **Java** and **Maven** are installed on your VM.
14+
Download Maven and extract it:
15+
16+
```console
17+
cd /opt
18+
sudo wget https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
19+
sudo tar -xvzf apache-maven-3.8.6-bin.tar.gz
20+
sudo mv apache-maven-3.8.6 /opt/maven
21+
```
22+
23+
### Set Environment Variables
24+
Configure the environment so Maven commands are recognized system-wide:
25+
26+
```console
27+
echo "export M2_HOME=/opt/maven" >> ~/.bashrc
28+
echo "export PATH=\$M2_HOME/bin:\$PATH" >> ~/.bashrc
29+
source ~/.bashrc
30+
```
31+
Verify the Maven installation:
32+
33+
```console
34+
mvn -version
35+
```
36+
At this point, both Java and Maven are installed and ready to use.
37+
38+
### Start the Flink Cluster
39+
Before proceeding to start the Flink cluster, you need to allow port 8081 from your GCP console.
40+
41+
Start the Flink cluster using the provided startup script:
42+
43+
```console
44+
cd $FLINK_HOME
45+
./bin/start-cluster.sh
46+
```
47+
48+
You should see output similar to:
49+
```output
50+
Starting cluster.
51+
[INFO] 1 instance(s) of standalonesession are already running on lpprojectsusearm64.
52+
Starting standalonesession daemon on host lpprojectsusearm64.
53+
Starting taskexecutor daemon on host lpprojectsusearm64.
54+
```
55+
56+
Verify that the JobManager and TaskManager processes are running:
57+
58+
```console
59+
jps
60+
```
61+
62+
You should see output similar to:
63+
```output
64+
21723 StandaloneSessionClusterEntrypoint
65+
2621 Jps
66+
2559 TaskManagerRunner
67+
```
68+
69+
### Access the Flink Web UI
70+
71+
Open the Flink Web UI in a browser:
72+
73+
```console
74+
http://<VM_IP>:8081
75+
```
76+
77+
- A successfully loaded dashboard confirms the cluster network and UI functionality.
78+
-This serves as the baseline for network and UI validation.
79+
80+
![Flink Dashboard alt-text#center](images/flink-dashboard.png "Figure 1: Flink Dashboard")
81+
82+
### Run a Simple Example Job
83+
Execute a sample streaming job to verify that Flink can run tasks correctly:
84+
85+
```console
86+
cd $FLINK_HOME
87+
./bin/flink run examples/streaming/WordCount.jar
88+
```
89+
90+
- Monitor the job in the Web UI or check console logs.
91+
- Confirm that the job completes successfully.
92+
93+
![Flink Dashboard alt-text#center](images/wordcount.png "Figure 2: Word Count Job")
94+
95+
Flink baseline testing has been completed. You can now proceed to Flink benchmarking.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: Apache Flink Benchmarking
3+
weight: 6
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
10+
## Apache Flink Benchmarking
11+
This guide provides step-by-step instructions to set up and run **Apache Flink Benchmarks** on a **GCP SUSE VMs**. It covers cloning the repository, building the benchmarks, exploring the JAR, and listing available benchmarks.
12+
13+
### Clone the Repository
14+
Start by cloning the official Flink benchmarks repository. This repository contains all the benchmark definitions and example jobs.
15+
16+
```console
17+
cd ~
18+
git clone https://github.com/apache/flink-benchmarks.git
19+
cd flink-benchmarks
20+
```
21+
22+
### Build the Benchmarks with Maven
23+
Use Maven to compile the benchmarks and generate the benchmark JAR. Skip tests to save time.
24+
25+
```console
26+
mvn clean package -DskipTests
27+
```
28+
- **mvn clean package** → Cleans previous builds and packages the project.
29+
30+
After this step, the target directory will contain the compiled **benchmarks.jar**.
31+
32+
### Explore the JAR Contents
33+
Verify the generated files inside the `target` directory:
34+
35+
```console
36+
cd target
37+
ls
38+
```
39+
You should see an output similar to:
40+
41+
```output
42+
benchmark-0.1.jar classes generated-test-sources maven-status protoc-plugins
43+
benchmarks.jar generated-sources maven-archiver protoc-dependencies test-classes
44+
```
45+
- **benchmarks.jar**→ The main benchmark JAR file used to run Flink benchmarks.
46+
47+
### List Available Benchmarks
48+
To view all the benchmarks included in the JAR:
49+
50+
```console
51+
java -jar benchmarks.jar -l
52+
```
53+
- `-l` → Lists all benchmarks packaged in the JAR.
54+
- This helps you identify which benchmarks you want to execute on your VM.
55+
56+
### Run Selected Benchmarks
57+
While the Flink benchmarking project includes multiple suites for state backends, windowing, checkpointing, and scheduler performance, this Learning path focuses on the Remote Channel Throughput benchmark to evaluate network and I/O performance.
58+
59+
**Remote Channel Throughput**: Measures the data transfer rate between remote channels in Flink, helping to evaluate network and I/O performance.
60+
```console
61+
java -jar benchmarks.jar org.apache.flink.benchmark.RemoteChannelThroughputBenchmark.remoteRebalance
62+
```
63+
You should see an output similar to:
64+
```output
65+
66+
Result "org.apache.flink.benchmark.RemoteChannelThroughputBenchmark.remoteRebalance":
67+
10536.511 ±(99.9%) 60.121 ops/ms [Average]
68+
(min, avg, max) = (10289.593, 10536.511, 10687.736), stdev = 89.987
69+
CI (99.9%): [10476.390, 10596.633] (assumes normal distribution)
70+
71+
# Run complete. Total time: 00:25:14
72+
Benchmark (mode) Mode Cnt Score Error Units
73+
RemoteChannelThroughputBenchmark.remoteRebalance ALIGNED thrpt 30 17445.341 ± 153.256 ops/ms
74+
RemoteChannelThroughputBenchmark.remoteRebalance DEBLOAT thrpt 30 10536.511 ± 60.121 ops/ms
75+
```
76+
77+
### Flink Benchmark Metrics Explained
78+
79+
- **Run Count**: Total benchmark iterations executed, higher count improves reliability.
80+
- **Average Throughput**: Mean operations per second across all iterations.
81+
- **Standard Deviation**: Variation from average throughput, smaller means more consistent.
82+
- **Confidence Interval (99.9%)**: Range where the true average throughput lies with 99.9% certainty.
83+
- **Min Throughput**: The lowest throughput was observed, and it shows worst-case performance.
84+
- **Max Throughput**: Highest throughput observed, shows best-case performance.
85+
86+
### Benchmark summary on x86_64
87+
To compare the benchmark results, the following results were collected by running the same benchmark on a `x86 - c4-standard-4` (4 vCPUs, 15 GB Memory) x86_64 VM in GCP, running SUSE:
88+
89+
| Benchmark | Mode | Count | Score (ops/ms) | Error (±) | Min | Max | Stdev | CI (99.9%) | Units |
90+
|---------------------------------------------------|---------|-------|----------------|-----------|------------|------------|---------|------------------------|--------|
91+
| RemoteChannelThroughputBenchmark.remoteRebalance | ALIGNED | 30 | 24873.046 | 892.673 | 11195.028 | 12425.761 | 421.057 | [11448.649, 12011.275] | ops/ms |
92+
| RemoteChannelThroughputBenchmark.remoteRebalance | DEBLOAT | 30 | 11729.962 | 281.313 | 11195.028 | 12425.761 | 421.057 | [11448.649, 12011.275] | ops/ms |
93+
94+
### Benchmark summary on Arm64
95+
Results from the earlier run on the `c4a-standard-4` (4 vCPU, 16 GB memory) Arm64 VM in GCP (SUSE):
96+
97+
| Benchmark | Mode | Count | Score (ops/ms) | Error (±) | Min | Max | Stdev | CI (99.9%) | Units |
98+
|---------------------------------------------------|---------|-------|----------------|-----------|-----------|-----------|---------|------------------------|--------|
99+
| RemoteChannelThroughputBenchmark.remoteRebalance | ALIGNED | 30 | 17445.341 | 153.256 | 10289.593 | 10687.736 | 89.987 | [10476.390, 10596.633] | ops/ms |
100+
| RemoteChannelThroughputBenchmark.remoteRebalance | DEBLOAT | 30 | 10536.511 | 60.121 | 10289.593 | 10687.736 | 89.987 | [10476.390, 10596.633] | ops/ms |
101+
102+
### Apache Flink performance benchmarking comparison on Arm64 and x86_64
103+
104+
- The **ALIGNED mode** achieved an average throughput of **17,445 ops/ms**, demonstrating higher performance on the Arm64 VM.
105+
- The **DEBLOAT mode** achieved an average throughput of **10,537 ops/ms**, slightly lower due to optimization differences.
106+
- The benchmark confirms that the **Arm64 architecture** efficiently handles Flink's remote channel throughput workloads.
107+
- Overall, the average throughput across both modes is approximately **14,854 ops/ms**, indicating strong baseline performance for Arm64 deployments.
92.8 KB
Loading
261 KB
Loading
115 KB
Loading
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: Install Apache Flink
3+
weight: 4
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Install Apache Flink on GCP VM
10+
This guide walks you through installing **Apache Flink** and its required dependencies on a **Google Cloud Platform (GCP) SUSE Arm64 Virtual Machine (VM)**. By the end of this section, you will have a fully configured Flink environment ready for job execution and benchmarking.
11+
12+
### Update the System and Install Java
13+
Before installing Flink, ensure your system packages are up to date and Java is installed.
14+
15+
```console
16+
sudo zypper refresh
17+
sudo zypper update -y
18+
sudo zypper install -y java-17-openjdk java-17-openjdk-devel
19+
```
20+
This step ensures you have the latest system updates and the Java runtime needed to execute Flink applications.
21+
22+
### Download Apache Flink Binary
23+
Next, download the pre-built binary package for **Apache Flink** from the official Apache mirror.
24+
25+
```console
26+
cd /opt
27+
sudo wget https://dlcdn.apache.org/flink/flink-2.1.0/flink-2.1.0-bin-scala_2.12.tgz
28+
```
29+
This command retrieves the official Flink binary distribution for installation on your VM.
30+
31+
{{% notice Note %}}
32+
Flink 2.0.0 introduced Disaggregated State Management architecture, which enables more efficient resource utilization in cloud-native environments, ensuring high-performance real-time processing while minimizing resource overhead.
33+
You can view [this release note](https://flink.apache.org/2025/03/24/apache-flink-2.0.0-a-new-era-of-real-time-data-processing/)
34+
35+
The [Arm Ecosystem Dashboard](https://developer.arm.com/ecosystem-dashboard/) recommends Flink version 2.0.0, the minimum recommended on the Arm platforms.
36+
{{% /notice %}}
37+
38+
### Extract the Downloaded Archive
39+
Extract the downloaded `.tgz` archive to make the Flink files accessible for configuration.
40+
41+
```console
42+
sudo tar -xvzf flink-2.1.0-bin-scala_2.12.tgz
43+
```
44+
After extraction, you will have a directory named `flink-2.1.0` under `/opt`.
45+
46+
**Rename the extracted directory for convenience:**
47+
For easier access and management, rename the extracted Flink directory to a simple name like `/opt/flink`.
48+
49+
```console
50+
sudo mv flink-2.1.0 /opt/flink
51+
```
52+
This makes future references to your Flink installation path simpler and more consistent.
53+
54+
### Configure Environment Variables
55+
Set the environment variables so the Flink commands are recognized system-wide. This ensures you can run `flink` from any terminal session.
56+
57+
```console
58+
echo "export FLINK_HOME=/opt/flink" >> ~/.bashrc
59+
echo "export PATH=\$FLINK_HOME/bin:\$PATH" >> ~/.bashrc
60+
```
61+
62+
Additionally, create a dedicated log directory for Flink and assign proper permissions:
63+
```console
64+
sudo mkdir -p /opt/flink/log
65+
sudo chown -R $(whoami):$(id -gn) /opt/flink/log
66+
sudo chmod -R 755 /opt/flink/log
67+
```
68+
69+
**Apply the changes:**
70+
71+
```console
72+
source ~/.bashrc
73+
```
74+
75+
### Verify the Installation
76+
To confirm that Flink has been installed correctly, check its version:
77+
78+
```console
79+
flink -v
80+
```
81+
82+
You should see an output similar to:
83+
84+
```output
85+
Version: 2.1.0, Commit ID: 4cb6bd3
86+
```
87+
This confirms that Apache Flink has been installed and is ready for use.

0 commit comments

Comments
 (0)