OpenMLDB Benchmak tool is used for tesing the performance of OpenMLDB's online SQL engine.
You may also refer to FEBench (https://github.com/decis-bench/febench), which is a more comprehensive benchmark for real-time feature extraction developed by a third-party, comparing the performance between OpenMLDB and Flink.
- CentOS 7 / macOS >= 10.15
- JDK 1.8
- Compile
cd benchmark mvn clean package
- Copy the configuration and package
mkdir -p /work/benchmark/conf /work/benchmark/lib cp target/openmldb-benchmark-0.5.0.jar /work/benchmark/lib cp src/main/resources/conf.properties /work/benchmark/conf
- Modify the configuration
ZK_CLUSTER=127.0.0.1:32200 ZK_PATH=/udf_test
- Run benchmark
cd /work/benchmark java -cp conf/:lib/* com._4paradigm.openmldb.benchmark.OpenMLDBPerfBenchmark
The above testing run with the default confguration. You can modify WINDOW_NUM
, WINDOW_SIZE
and JOIN_NUM
in the confguration file if you want to evaluate the performance impact of those parameters.
Moreover, the default number of threads is 10. You need to set the thread number by Threads
annotation in OpenMLDBPerfBenchmark.java
or OpenMLDBLongWindowBenchmark.java
as below and compile again if you want to test under other thread confguration.
@Threads(10)
If you want to test Throughput
, set BenchmarkMode
and OutputTimeUnit
annotation in OpenMLDBPerfBenchmark.java
or OpenMLDBLongWindowBenchmark.java
file as below:
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.SECONDS)
Update WINDOW_SIZE
in confguration file and execute the following command.
java -cp conf/:lib/ com._4paradigm.openmldb.benchmark.OpenMLDBLongWindowBenchmark
Note: If you want to test specific SQL, you can modify here
We provide two ways to measure OpenMLDB's memory usage. First, you can conduct comparative testing using a dataset composed of randomly generated data in a specified format. Second, you can conduct comparative testing using the existing TalkingData dataset.
-
Configure memory.properties
You need to configure the service addresses for your OpenMLDB and Redis instances in the configuration file. Additionally, you can configure parameters such as KEY_LENGTH, VALUE_LENGTH, VALUE_PER_KEY, and TOTAL_KEY_NUM based on your requirements, which are used for Approach One.
-
Start the test by executing the following command:
# using generated dataset java -cp conf/:lib/* com._4paradigm.openmldb.memoryusagecompare.BenchmarkMemoryUsage # using TalkingData java -cp conf/:lib/* com._4paradigm.openmldb.memoryusagecompare.BenchmarkMemoryUsageByTalkingData
-
The test report will be printed at the end of the test execution.
Similar to memory usage comparison testing, we also provide two approaches for testing index memory usage.
-
Configure memory.properties.
Configure the service addresses for your OpenMLDB.
-
Start the test by executing the following command:
# using generated dataset java -cp conf/:lib/* com._4paradigm.openmldb.memoryusagecompare.BenchmarkIndexMemoryUsage # using TalkingData java -cp conf/:lib/* com._4paradigm.openmldb.memoryusagecompare.BenchmarkIndexMemoryUsageByTalkingData
-
The test report will be printed at the end of the test execution.
Note:
- You can get the TalkingData sample dataset from here, or you can get the full TalkingData training dataset from here.
- The full TalkingData dataset is too large, so we recommend extracting a portion of it for testing.
Comparing the query performance of OpenMLDB and Redis under the same scenario.
-
Configure memory.properties.
Configure the service addresses for your OpenMLDB and Redis instances, and modify the configuration parameters in the 'query perf test' section according to the requirements.
-
(Optional) Load data into OpenMLDB.
-
Start the test by executing the following command:
java -cp conf/:lib/* com._4paradigm.openmldb.memoryusagecompare.BenchmarkQueryPerf
-
The test report will be printed at the end of the test execution.