AHBench is a benchmark toolkit developed by the Alibaba Cloud Lindorm team. You can use AHBench to benchmark Lindorm clusters or HBase clusters with just a few clicks.
Introduction
The AHBench toolkit includes the Yahoo! Cloud Serving Benchmark (YCSB) software. YCSB provides features such as test sets, test process control, and result aggregation. The configuration of AHBench is simple, allowing you to perform benchmark tests with just a few clicks.
Preparations
Deploy the stress testing client on an ECS instance. To ensure network connectivity, make sure that your Lindorm instance and the ECS instance meet the following requirements. For more information about how to view the information about an ECS instance, see View instance information.
The Lindorm instance and the ECS instance are deployed in the same region. We recommend that you deploy the two instances in the same zone to reduce network latency.
The network types of your Lindorm instance and ECS instance are the same.
NoteWe recommend that you deploy the two instances in a virtual private cloud (VPC) for better security.
If you set the network types of the instances to VPC, make sure that you specify the same VPC ID for the instances.
Add the IP address of the stress testing client to the whitelist of your Lindorm instance.
Download the AHBench toolkit, upload the package to your stress testing client, and then extract the package.
Usage notes
The system you benchmark may be overwhelmed and stop responding during the stress test. Do not use AHBench in a production environment.
AHBench uses the ahbenchtest-read and ahbenchtest-write tables for testing. These tables may be deleted and recreated during the test. Make sure that the tables can be deleted without causing issues.
Make sure that the cluster you want to test has sufficient storage space.
Lindorm clusters run on ECS instances that provide virtual runtime environments. The performance of clusters with the same specification may vary in a range of 5% to 10%.
Runtime environment
The runtime environment for the stress testing client must meet the following requirements:
The client runs Linux.
JDK 1.8 +
Python 2.7
The client has at least 16 exclusive CPU cores.
Configure a cluster endpoint
Specify the endpoint of the Lindorm cluster or HBase cluster that you want to benchmark in the AHBench/conf/hbase-site.xml file.
For more information about how to access Lindorm, see Use HBase Java API for application development. Add the following settings to the hbase-site.xml file:
<property>
<name>hbase.client.connection.impl</name>
<value>org.apache.hadoop.hbase.client.AliHBaseUEClusterConnection</value>
</property>Configure environment variables
Configure environment variables for AHBench in the AHBench/conf/ahbench-env.properties file.
Run the following command to open the ahbench-env.properties file:
vi AHBench/conf/ahbench-env.propertiesSpecify the path where the Java Development Kit (JDK) is installed. Example:
JAVA_HOME=/usr/java/jdk1.8.0/. If the JDK is already installed in the system path, skip this step.Configure the version of the HBase cluster that you want to test. If the cluster version is 1.x, set the parameter to 1. If the cluster version is 2.x, set the parameter to 2.
HBASE_VERSION=2
Configure the parameters that are related to stress testing (optional)
Open the AHBench/conf/ahbench-settings.properties file and configure the parameters that define the compression algorithm, encoding algorithm, number of threads, data size, and field size. You can use the default values or change the values as needed.
Some parameters are supported only by specific Lindorm versions. For example, Zstandard compression and INDEX encoding are supported only by Alibaba Cloud Lindorm. You can configure Zstandard and INDEX to improve performance.
# Specify the compression algorithm for the test tables.
# Valid values: NONE, LZO, ZSTD, SNAPPY, GZ, LZ4, ZSTD, etc.
# Some compression algorithms are not supported by specific test systems.
# We recommend that you select ZSTD for Alibaba Cloud Lindorm.
ahbench.table.compression=SNAPPY
# Specify the encoding algorithm for the test tables. Valid values:
# NONE DIFF INDEX
# Some encoding algorithms are not supported by specific test systems.
# We recommend that you select the INDEX encoding algorithm for Alibaba Cloud Lindorm.
ahbench.table.encoding=DIFF
Perform a stress test
Quick test
The test dataset includes 10 million entries and occupies at least 20 GB storage. The test duration is about 40 minutes and varies based on the test system.
cd AHBench ./fast_testFull test
The test dataset includes 2 billion entries and occupies at least 2 TB storage. The test duration is about 25 hours and varies based on the test system.
cd AHBench ./full_testIf you want to repeat a test, you can skip the data import step (if the previous test was successfully completed) to reduce the test duration. If you skip the data import step, the test duration is about 3.5 hours and varies based on the test system.
cd AHBench ./full_test --skipload
Analyze test results
After you complete a test, a comma-separated values (CSV) file is generated in the current directory. You can copy the test results to Excel, Numbers, or other data analytics software and then compare or analyze the test results.
View the name of the CSV file:
ls -ltrView the content of the specified CSV file:
cat full_throughput.csv
The following figure shows the content of the CSV file.

FAQ
If AHBench shuts down due to an error, check the following items:
Check whether JAVA_HOME is set to a valid value and whether the Python runtime environment is installed.
Check whether the endpoint of the tested cluster is valid.
Check whether the HBase version of the tested cluster is valid.
Check whether the tested cluster supports the specified compression algorithm.
Check whether the tested cluster is running as expected.