ApsaraDB for SelectDB is a high-performance, easy-to-use data analysis service that excels at wide table aggregation, multi-table joins, and high-concurrency point queries. This topic explains how to use the TPC-DS benchmark to test the complex query performance of SelectDB in a Linux environment and provides the test results.
Overview
TPC-DS is a decision support benchmark from the Transaction Processing Performance Council (TPC). It evaluates system performance on complex queries and large-scale data analysis.
TPC-DS simulates complex decision support workloads. It tests system performance with complex queries and data operations, including joins, aggregations, sorts, filters, and subqueries. These queries cover diverse scenarios, such as report generation, data mining, and online analytical processing (OLAP).
Prerequisites
Step 1: Prepare the target instance
-
Prepare an instance.
If you already have a target instance, check its configuration against the following requirements.
If you do not have a target instance, create one.
-
kernel version 4.1 or later.
If you have a target instance but its kernel version is earlier than 4.1, you can upgrade the instance to meet the requirement. For more information, see Update the kernel version.
-
The specification must be 96-core 384 GB or higher. The test in this guide uses an instance with a 96-core, 384 GB specification.
-
The cluster cache space must be 1200 GB or greater. The test in this guide uses a cluster cache space of 1200 GB.
-
-
Set the
streaming_load_max_mbparameter to its maximum value.During the test, the tool uploads test data to SelectDB using Stream Load. Because the test dataset exceeds the default import limit of 10,240 MB, you must increase the
streaming_load_max_mbBE parameter to its maximum value of 10,240,000 MB. For more information about how to modify parameters, see Parameter configuration. -
Create a destination database for importing the test data.
If you already have a destination database, skip this step.
-
Connect to the instance. For more information, see Connect to an ApsaraDB for SelectDB instance using a MySQL client.
-
Create the database.
The destination database for this test is
test_db. Run the following statement:CREATE DATABASE test_db;
-
Step 2: Prepare the test server
The following installation scripts are for Linux. If you use a different operating system, modify the scripts accordingly.
Notes
-
If you plan to use Git on the server to download the TPC-DS test tool, you must enable public network access.
-
For a new ECS instance: When you create the ECS instance, select Assign Public IPv4 Address for Public IP.
-
For an existing ECS instance without public network access: To enable public network access for the ECS instance, see Enable public bandwidth.
-
-
The data files generated from the test dataset are approximately 1,000 GB. Ensure that the server has sufficient storage.
-
Create a target server.
If you already have a target server, skip this step.
If you do not have a target server, you can create an ECS instance on the Custom Launch tab and select Alibaba Cloud Linux for the image.
-
Install the test dependencies.
-
Install the MySQL client.
yum install mysql -
Install unzip.
yum install unzip -
Install jq.
yum install jq -
Install CURL.
yum install curl
-
-
(Optional) Install Git.
You can skip this step if you have already downloaded the TPC-DS tool and plan to upload it manually.
yum install git
Step 3: Ensure network connectivity
Ensure network connectivity between the TPC-DS test server and the SelectDB instance:
-
Apply for a public endpoint for the SelectDB instance. For more information, see Apply for and release a public endpoint.
Skip this step if your test server is an Alibaba Cloud server in the same VPC as the ApsaraDB for SelectDB instance.
-
Add the IP address of the TPC-DS test server to the IP address whitelist of the ApsaraDB for SelectDB instance. For more information, see Configure an IP address whitelist.
Step 4: Test dataset
Standard TPC-DS test datasets may not represent real-world workloads, and benchmark tests often involve parameter tuning for the dataset. Therefore, these results reflect database performance only in specific scenarios. We recommend running additional tests with your own production data.
In this TPC-DS test, 1000 GB of data is generated and imported into SelectDB to test the performance of SelectDB. The following describes the tables in the 1000 GB test dataset.
|
Table name |
Rows |
|
customer_demographics |
1,920,800 |
|
reason |
65 |
|
warehouse |
20 |
|
date_dim |
73,049 |
|
catalog_sales |
1,439,980,416 |
|
call_center |
42 |
|
inventory |
783,000,000 |
|
catalog_returns |
143,996,756 |
|
household_demographics |
7,200 |
|
customer_address |
6,000,000 |
|
income_band |
20 |
|
catalog_page |
30,000 |
|
item |
300,000 |
|
web_returns |
71,997,522 |
|
web_site |
54 |
|
promotion |
1,500 |
|
web_sales |
720,000,376 |
|
store |
1,002 |
|
web_page |
3,000 |
|
time_dim |
86,400 |
|
store_returns |
287,999,764 |
|
store_sales |
2,879,987,999 |
|
ship_mode |
20 |
|
customer |
12,000,000 |
Procedure
These scripts are for servers running the Linux operating system. You must modify them for other operating systems.
Step 1: Log in to the target server
If your server is an ECS instance, see Choose a connection method.
For other server types, see their product documentation for login instructions.
Step 2: Install the TPC-DS test tool
-
Download the tool.
Run the following command to download the tool using Git.
git clone https://github.com/apache/doris.git && cd ./doris/tools/tpcds-tools -
Compile the tool.
Run the following script to compile the tool.
sh bin/build-tpcds-tools.sh
Step 3: Generate the TPC-DS test dataset
The larger the dataset, the longer it takes to generate, depending on your server's performance.
Run the script to generate the test dataset from the installation directory of the test tool.
Syntax:
sh bin/gen-tpcds-data.sh -s <dataSizeInGB>
Parameter description:
dataSizeInGB:
-
Description: The size of the dataset to generate using TPC-DS.
-
Unit: GB
This test generates a 1000 GB (1 TB) test dataset. This step can take a long time. We recommend running this task in the background:
nohup sh bin/gen-tpcds-data.sh -s 1000 > gen-tpcds-data.log 2>&1 &
The execution output is saved to the gen-tpcds-data.log file in the test tool's installation directory. You can check this file to verify that the process is running correctly.
The test dataset is saved as .dat files in the tpcds-data directory. This directory is located in the bin directory of the test tool's installation path.
Step 4: Create test tables in SelectDB
-
Configure SelectDB instance information.
Before you execute the table creation script, you need to configure information about the SelectDB instance in the
doris-cluster.conffile. This file is located in thetpcds-tools/conf/directory of the test tool installation. The following is an example.# Any of FE host export FE_HOST='selectdb-cn-******.selectdbfe.rds.aliyuncs.com' # http_port in fe.conf export FE_HTTP_PORT=8080 # query_port in fe.conf export FE_QUERY_PORT=9030 # Doris username export USER='admin' # Doris password export PASSWORD='******' # The database where TPC-DS tables located export DB='test_db'Parameter description:
Parameter
Description
FE_HOST
The endpoint of the SelectDB instance.
You can find the VPC endpoint or public endpoint from the Network Information section of the instance details page in the SelectDB console.
FE_HTTP_PORT
The HTTP port of the SelectDB instance.
The default port is 8080 for SelectDB.
You can get the HTTP protocol port from the Network Information section of the instance details page in the SelectDB console.
FE_QUERY_PORT
The MySQL port of the SelectDB instance.
The default port is 9030 for SelectDB.
You can get the MySQL protocol port from the Network Information section of the instance details page in the SelectDB console.
USER
The account for the SelectDB instance.
When you create a SelectDB instance, an
adminaccount is created by default.PASSWORD
The password for the SelectDB instance account.
If you are using the
adminaccount and have forgotten the password, you can reset the admin password of the instance in the console.DB
The name of the database in the SelectDB instance to import data into.
-
Create tables.
Run the following script in the test tool's installation directory to create the test tables. After the script completes, it creates the tables described in Step 4: Understand the test dataset in the target database of your SelectDB instance.
sh bin/create-tpcds-tables.sh -s 1000
Step 5: Import data into SelectDB
The larger the test dataset, the longer it takes to import, depending on your server's performance.
Run the following script in the test tool's installation directory to import all TPC-DS test data into SelectDB.
sh bin/load-tpcds-data.sh
This test imports a 1000 GB (1 TB) test dataset into SelectDB. This step can take a long time. We recommend that you run this task in the background:
nohup sh bin/load-tpcds-data.sh > load-tpcds-data.log 2>&1 &
The execution output is saved to the load-tpcds-data.log file in the test tool's installation directory. You can check this file to monitor the import process.
Step 6: Test query performance
-
Test batch query performance
ImportantThe larger the dataset, the longer the batch test takes, depending on the performance of your server.
You can run the TPC-DS test SQL script to execute the test suite's SQL queries in batches.
Syntax:
sh bin/run-tpcds-queries.sh -s <dataSizeInGB>Parameter description:
dataSizeInGB: Make sure the query runs against the correct data scale. This value must match the scale used for data generation (for example, if you used
-s 1000, you must also use-s 1000to run queries).After the script is complete, the console window displays the performance results for each SQL query in the test suite on SelectDB.
This test queries a 1000 GB (1 TB) test dataset. This step can take a long time. We recommend that you run this task in the background:
nohup sh bin/run-tpcds-queries.sh -s 1000 > run-tpcds-queries.log 2>&1 &The query results are saved to the run-tpcds-queries.log file in the test tool's installation directory. You can check this file to monitor the query process and view the final test results. For the test results from the 1000 GB dataset used in this document, see Test results.
-
Test single query performance
To test the performance of a single SQL query on SelectDB, follow these steps:
-
Connect to the SelectDB instance. For instructions, see Connect to ApsaraDB for SelectDB with DMS.
-
Execute the target SQL statement. The SQL statements are available in TPCDS-Query-SQL.
NoteThe SQL statements in TPCDS-Query-SQL are the same as those executed by the batch test script.
-
Test results
This section shows the TPC-DS 1000 GB benchmark test results for Alibaba Cloud SelectDB Cloud-4.1.5, run on an instance with 96 cores, 384 GB of memory, and a 1200 GB cache size.
For comparison, this section also includes results from the open source version, Apache Doris-3.1.4, tested on an instance with identical specifications. The results show that with sufficient cache, the query performance of a storage-compute separation architecture is nearly identical to that of a storage-compute integrated architecture.
|
Query |
Cloud-4.1.5 (s) |
Apache Doris-3.1.4 (s) |
|
Q1 |
0.34 |
0.389 |
|
Q2 |
2.55 |
2.485 |
|
Q3 |
0.23 |
0.239 |
|
Q4 |
6.69 |
6.703 |
|
Q5 |
0.29 |
0.354 |
|
Q6 |
0.11 |
0.152 |
|
Q7 |
0.27 |
0.313 |
|
Q8 |
0.22 |
0.244 |
|
Q9 |
3.98 |
3.924 |
|
Q10 |
0.15 |
0.182 |
|
Q11 |
4.24 |
4.349 |
|
Q12 |
0.1 |
0.104 |
|
Q13 |
0.28 |
0.313 |
|
Q14_1 |
3.98 |
4.963 |
|
Q14 |
3.87 |
4.839 |
|
Q15 |
0.25 |
0.265 |
|
Q16 |
0.22 |
0.245 |
|
Q17 |
0.5 |
0.545 |
|
Q18 |
0.42 |
0.439 |
|
Q19 |
0.13 |
0.145 |
|
Q20 |
0.12 |
0.126 |
|
Q21 |
0.05 |
0.064 |
|
Q22 |
0.71 |
0.731 |
|
Q23_1 |
11.91 |
12.464 |
|
Q23 |
11.98 |
12.357 |
|
Q24_1 |
2.14 |
2.152 |
|
Q24 |
2.12 |
2.137 |
|
Q25 |
0.39 |
0.424 |
|
Q26 |
0.15 |
0.152 |
|
Q27 |
0.27 |
0.293 |
|
Q28 |
3.76 |
3.733 |
|
Q29 |
0.39 |
0.417 |
|
Q30 |
0.19 |
0.214 |
|
Q31 |
1.07 |
1.161 |
|
Q32 |
0.04 |
0.047 |
|
Q33 |
0.18 |
0.201 |
|
Q34 |
0.31 |
0.327 |
|
Q35 |
0.78 |
0.857 |
|
Q36 |
0.25 |
0.265 |
|
Q37 |
0.09 |
0.098 |
|
Q38 |
6.01 |
2.194 |
|
Q39_1 |
0.2 |
0.224 |
|
Q39 |
0.18 |
0.187 |
|
Q40 |
0.08 |
0.088 |
|
Q41 |
0.03 |
0.049 |
|
Q42 |
0.05 |
0.062 |
|
Q43 |
0.58 |
0.593 |
|
Q44 |
1.16 |
1.168 |
|
Q45 |
0.17 |
0.192 |
|
Q46 |
0.46 |
0.479 |
|
Q47 |
2.59 |
2.525 |
|
Q48 |
0.23 |
0.239 |
|
Q49 |
0.3 |
0.335 |
|
Q50 |
0.44 |
0.457 |
|
Q51 |
4.15 |
4.379 |
|
Q52 |
0.05 |
0.067 |
|
Q53 |
0.19 |
0.198 |
|
Q54 |
0.86 |
0.862 |
|
Q55 |
0.05 |
0.06 |
|
Q56 |
0.14 |
0.164 |
|
Q57 |
1.43 |
1.469 |
|
Q58 |
0.16 |
0.167 |
|
Q59 |
3.26 |
3.29 |
|
Q60 |
0.18 |
0.21 |
|
Q61 |
0.18 |
0.21 |
|
Q62 |
0.67 |
0.697 |
|
Q63 |
0.17 |
0.181 |
|
Q64 |
1.27 |
1.298 |
|
Q65 |
3.04 |
3.212 |
|
Q66 |
0.26 |
0.272 |
|
Q67 |
23.76 |
24.677 |
|
Q68 |
0.31 |
0.314 |
|
Q69 |
0.17 |
0.183 |
|
Q70 |
1.63 |
1.615 |
|
Q71 |
0.24 |
0.52 |
|
Q72 |
1.79 |
1.924 |
|
Q73 |
0.25 |
0.261 |
|
Q74 |
3.67 |
3.835 |
|
Q75 |
3.17 |
3.298 |
|
Q76 |
0.8 |
0.919 |
|
Q77 |
0.16 |
0.182 |
|
Q78 |
9.24 |
9.364 |
|
Q79 |
1.53 |
1.613 |
|
Q80 |
0.3 |
0.323 |
|
Q81 |
0.32 |
0.358 |
|
Q82 |
0.18 |
0.205 |
|
Q83 |
0.11 |
0.119 |
|
Q84 |
0.09 |
0.099 |
|
Q85 |
0.3 |
0.387 |
|
Q86 |
0.42 |
0.455 |
|
Q87 |
6.45 |
2.836 |
|
Q88 |
3.02 |
2.998 |
|
Q89 |
0.3 |
0.313 |
|
Q90 |
0.11 |
0.127 |
|
Q91 |
0.08 |
0.1 |
|
Q92 |
0.03 |
0.045 |
|
Q93 |
0.93 |
0.961 |
|
Q94 |
0.18 |
0.198 |
|
Q95 |
0.25 |
0.257 |
|
Q96 |
0.38 |
0.385 |
|
Q97 |
3.15 |
3.133 |
|
Q98 |
0.2 |
0.315 |
|
Q99 |
1.37 |
1.44 |
|
Total |
159.15 |
158.699 |