|
| 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. |
0 commit comments