AHBench is a benchmark test suite developed by the ApsaraDB for HBase team.
This test suite is integrated with the Yahoo! Cloud Serving Benchmark (YCSB) and provides features such as test sets, test process control, and results aggregation. The configuration of AHBench is simple. You can use this test suite to perform benchmark tests with a few clicks.
Download AHBench
Download AHBench, upload the file to your stress testing client, and then decompress the file.
Precautions
- The test suite uses the ahbenchtest-read and ahbenchtest-write tables for testing. You may delete and recreate the tables during the test. Make sure that the tables can be deleted in a secure manner.
- The system may not respond due to the heavy workload during the test. We recommend that you do not use the test suite in a production environment.
- Make sure that the test cluster has sufficient storage.
- ApsaraDB for HBase clusters run on Elastic Compute Service (ECS) instances that provide a virtual runtime environment. The performance of clusters that have the same specification may vary by 5% and 10%.
Configure the runtime environment
- The client runs in a Linux operating system.
- JDK 1.8 +
- python 2.7
- The client has at least 16 exclusive CPU cores.
Configure the endpoint of the ApsaraDB for HBase cluster
- Configure the endpoint of the ApsaraDB for HBase cluster that you want to test in the AHBench/conf/hbase-site.xml file.
- For more information about how to configure ZooKeeper endpoints for ApsaraDB for HBase clusters of Standard Edition, see Use HBase Shell to access an ApsaraDB for HBase Standard Edition instance.
- For more information about how to configure endpoints for ApsaraDB for HBase clusters of Performance-enhanced Edition, see Use HBaseue Shell to access an ApsaraDB for HBase Performance-enhanced Edition instance.
Configure variables of the runtime environment
Configure variables of the runtime environment in the AHBench/conf/ahbench-env.properties file.
vi AHBench/conf/ahbench-env.properties
# Specify the installation path for the Java Development Kit (JDK). If the JDK is installed in the system path, skip this step.
# JAVA_HOME=/usr/java/jdk1.8.0/
# Specify the version of the ApsaraDB for HBase cluster that you want to test. If you use a 1.x version, set the parameter to 1. If you use a 2.x version, set the parameter to 2.
HBASE_VERSION=2
Configure parameters for 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 based on your business requirements.
# Configure the compression algorithm of the test table.
# Valid values: NONE, LZO, ZSTD, SNAPPY, GZ, LZ4, and ZSTD.
# Take note that some compression algorithms are not supported in some test systems.
# We recommend that you use the ZSTD compression algorithm for ApsaraDB for HBase Performance-enhanced Edition.
ahbench.table.compression=SNAPPY
# Configure the encoding algorithm for the test table. The following encoding algorithms are supported:
# NONE DIFF INDEX
# Take note that some encoding algorithms are not supported in some test systems.
# We recommend that you use the INDEX encoding algorithm for ApsaraDB for HBase Performance-enhanced Edition.
ahbench.table.encoding=DIFF
Start a test
- Quick test
The test data includes 10 million entries, which occupy at least 20 GB of storage. The test requires approximately 40 minutes and the actual time may vary based on the test system.
cd AHBench ./fast_test
- Full test
The test data includes 2 billion entries, which occupy at least 2 TB of storage. The test requires approximately 25 hours and the actual time may vary based on the test system.
cd AHBench ./full_test
If you want to repeat a test that is successful, you do not need to import data again. This saves time. A test requires approximately 3.5 hours if you skip data import. The actual time may vary 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 import the test results to data analysis software such as Excel or Numbers for comparison and analysis.
FAQ
If AHBench unexpectedly quits 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 test cluster is valid.
- Check whether the version of the test cluster is valid.
- Check whether the test cluster supports the specified compression algorithm.
- Check whether the test cluster is running as expected.