This document describes how to use the Nexmark benchmark suite to evaluate the stream processing performance of Realtime Compute for Apache Flink.
Performance at a glance
Nexmark is an industry-standard benchmark suite for stream processing engines. It includes 21 queries that cover typical scenarios such as filtering, aggregation, JOINs, and windows. This document presents a comprehensive performance evaluation of Realtime Compute for Apache Flink using the Nexmark benchmark suite, an 8 CU configuration, and a baseline of 100 million input records. The results show:
The RPS for simple queries, such as q0, q1, and q2, can reach 4 to 6.5 million.
The RPS for complex aggregation and window queries, such as q4, q5, and q16, ranges from 150,000 to 630,000.
Test tool
Nexmark is a standard performance benchmark suite for stream processing engines. The test model is as follows:
Nexmark source table: Generates test data (Person, Auction, and Bid events) at a specified rate.
Transformations: 21 standard Nexmark queries that cover typical scenarios such as filtering, transformation, aggregation, JOINs, and windows.
Blackhole result table: Writes data to a blackhole sink to eliminate performance interference from external storage, focusing the evaluation on the processing capabilities of the Flink engine.
The Nexmark test tool used in this document is built on the OpenAPI of Realtime Compute for Apache Flink. It automates the full workflow, including job creation, deployment, runtime monitoring, and result collection. You do not need to manually write SQL or create jobs in the console.
Test environment
The Flink jobs in this test used the following optimization configurations:
Parameter | Value | Description |
table.exec.mini-batch.enabled | true | Enables Mini-Batch aggregation. |
table.exec.mini-batch.allow-latency | 2s | The buffering interval for Mini-Batch. |
table.optimizer.distinct-agg.split.enabled | true | Enables split optimization for Distinct aggregation. |
execution.checkpointing.interval | 3min | The checkpoint interval. |
Prerequisites
Java Development Kit (JDK) 1.8.x or later.
An active workspace. For more information, see Activate Realtime Compute for Apache Flink.
The AccessKey ID and AccessKey Secret for your Alibaba Cloud account.
Procedure
Step 1: Download the test tool
Download and extract the Nexmark test tool package nexmark-flink.tar.gz.
After extraction, the directory structure is as follows:
nexmark-flink/
├── run_nexmark.sh # Test entry script
├── nexmark_env.sh # Environment variable configuration file (requires editing)
├── bin/ # Runtime scripts
├── conf/ # Flink job configurations
├── lib/ # JAR package (to be uploaded to the console)
└── queries-vvp/ # Nexmark Query SQL filesStep 2: Upload the Nexmark JAR
Log on to the Realtime Compute for Apache Flink console.
Click to enter the target namespace, and in the left navigation bar, select .
Select and upload the
nexmark-flink-0.2-SNAPSHOT.jarfile. This file is in thenexmark-flink/libdirectory of the test tool.After the upload is complete, click the file name to copy its OSS path. You will need this path for a parameter in a later step. The file path format varies by storage type:
OSS Bucket Storage:
oss://<your-bucket-name>/artifacts/namespaces/<your-namespace>/<your-file-name>Example:
oss://oss-test/artifacts/namespaces/flink-default/nexmark-flink-0.2-SNAPSHOT.jarFully Managed Storage:
oss://flink-fullymanaged-<your-workspace-id>/artifacts/namespaces/<your-namespace>/<your-file-name>Example: oss://flink-fullymanaged-e6a123456789/artifacts/namespaces/flink-default/nexmark-flink-0.2-SNAPSHOT.jar
To view the storage type of your workspace, go to the Realtime Compute for Apache Flink console, find the target workspace, and click Details in the Actions column.
Step 3: Configure runtime parameters
Edit the nexmark-flink/nexmark_env.sh file and configure the following parameters.
Parameter | Description | Example |
END_POINT | The service endpoint for Realtime Compute for Apache Flink. Select an endpoint based on your region. For more information, see Service endpoints. | ververica.cn-hangzhou.aliyuncs.com |
AK | The AccessKey ID of your Alibaba Cloud account. | - |
SK | The AccessKey Secret of your Alibaba Cloud account. | - |
WORK_SPACE | Your workspace ID. | e6a123456789 |
NAMESPACE | Your workspace namespace. | flink-default |
NE*******AR | The OSS path of the JAR package that you uploaded in Step 2. | oss://flink-fullymanaged-e6a123456789/artifacts/namespaces/flink-default/nexmark-flink-0.2-SNAPSHOT.jar |
FLINK_VERSION | The Flink engine version to test. | vvr-11.6-jdk11-flink-1.20 |
QUERIES | The queries to run. Separate multiple queries with commas, for example, | all |
Running all queries can be time-consuming. Each query involves stages such as job creation, data generation, and computation. We recommend that you first run a single query (for example, by setting QUERIES to q0) to verify that the environment and parameters are configured correctly before you run the full test suite.
Step 4: Run the test
In the
nexmark-flinkdirectory, run the following command../run_nexmark.shThe test tool automatically creates and runs the Nexmark jobs using OpenAPI.
After the test is complete, the output displays the duration of each query in milliseconds. Sample output:
INFO com.github.nexmark.flink.vvp.Nexmark - q0 13078 ============================================================================ ✓ Benchmark execution completed successfully ============================================================================
Performance results
The following table shows the performance results of the 21 Nexmark queries on Realtime Compute for Apache Flink with an 8 CU configuration. Each query processed 100 million input records. RPS is calculated by dividing the number of input records by the duration.
The following data was collected in a specific test environment. Actual performance may vary with hardware and engine updates. The results are for reference only.
Query | Duration (ms) | RPS |
q0 | 23450 | 4,264,392 |
q1 | 22824 | 4,381,353 |
q2 | 15224 | 6,568,576 |
q3 | 21558 | 4,638,649 |
q4 | 157117 | 636,468 |
q5 | 679277 | 147,215 |
q7 | 333837 | 299,547 |
q8 | 29939 | 3,340,125 |
q9 | 266563 | 375,146 |
q10 | 51202 | 1,953,049 |
q11 | 145983 | 685,011 |
q12 | 36991 | 2,703,360 |
q14 | 20012 | 4,997,002 |
q15 | 42734 | 2,340,057 |
q16 | 337293 | 296,478 |
q17 | 27076 | 3,693,308 |
q18 | 96335 | 1,038,044 |
q19 | 95121 | 1,051,293 |
q20 | 231482 | 431,999 |
q21 | 39693 | 2,519,336 |
q22 | 31228 | 3,202,254 |