Serverless read and write operations are measured in Capacity Units (CUs). For a single-row read operation that returns more than 4 KB of data, the number of read CUs consumed is calculated by dividing the actual data size by 4 KB and rounding up to the nearest integer.
Request billing
Serverless read and write operations are measured in Capacity Units (CUs). For a single-row read operation that returns more than 4 KB of data, the number of read CUs consumed is calculated by dividing the actual data size by 4 KB and rounding up to the nearest integer.
How CUs are metered
- For a single-row read operation that returns more than 4 KB of data, the number of read CUs consumed is the actual data size divided by 4 KB, rounded up to the nearest integer.
- For a batch read operation on multiple rows, the total number of read CUs consumed is the sum of the CUs consumed by each single-row read. The CUs for each row are calculated as described in the preceding rule.
- For a batch read operation that uses the Scan function, the number of read CUs consumed is calculated by summing the data size of the primary keys for all scanned rows and the data size of the attribute columns read from each row. This total is then divided by 4 KB and rounded up to the nearest integer. This means that if a Scan operation with a filter scans 100 rows on the server but returns only one row, the CU calculation is based on all 100 scanned rows.
CU metering example
Suppose 10 single-row read operations occur within one second.
This process involves 5 read operations, each reading a 3.78 KB row of data, for a total read size of (3.78 KB rounded up to 4 KB) × 5.
For the other 5 read operations that each read a 4.26 KB row of data, the total data size is calculated as (4.26 KB rounded up to the next multiple of 4 KB) × 5.
The total number of read CUs consumed in this second is (5 × 1) + (5 × 2) = 15. This is because a 3.78 KB read rounds up to one read CU, and a 4.26 KB read rounds up to two read CUs.
Storage billing
HBase Serverless storage billing is based on the size of each original KeyValue written to HBase, not the size of the compressed table. You can call the org.apache.hadoop.hbase.CellUtil.estimatedSerializedSizeOf() function to estimate the size of each KeyValue. Because HBase uses a Log-structured Merge-tree (LSM) storage structure, data that is deleted or has expired due to Time to Live (TTL) is not removed immediately. Storage space is reclaimed only after a compaction runs.
Pricing
Serverless currently offers two billing methods: subscription and pay-as-you-go. In the subscription model, you pre-purchase compute and storage resources. If your compute resource usage exceeds the purchased CU amount, you will receive a QuotaExceededException error. If your storage usage exceeds the purchased amount, the Serverless instance is write-locked. You can adjust the number of purchased CUs and the disk size at any time in the instance interface to adapt to business changes. In the pay-as-you-go model, you do not need to purchase compute and storage resources in advance. You are billed based on your actual resource usage. If there are no requests, there are no charges.
Subscription
| Billing item | Price |
| Requests | CNY 0.15/CU/month |
| Storage | 0.36 GB/month |
For example:
- If you purchase 10 CUs, the monthly fee is CNY 1.50. This means you can make requests that consume up to 10 CUs per second. If you exceed this limit, your requests are throttled. Unused CUs from one second do not carry over to the next.
- If you purchase 10 GB of storage space, the monthly fee is CNY 3.60. If the storage used by the Serverless instance exceeds 10 GB, the instance is write-locked. If you use less than 10 GB of storage, you are still charged the full monthly fee of CNY 3.60.
Pay-as-you-go
| Billing item | Price |
| Requests | CNY 0.004/10,000 CUs |
| Storage | 0.43 GB/month |
For the pay-as-you-go method, bills are generated on an hourly basis. For example, if a user consumes 30,000 CUs for requests in one hour, and the peak storage usage during that hour is 20 GB. The request fee for this hour is 30,000 CUs × (CNY 0.004 / 10,000 CUs) = CNY 0.01. The storage fee is 20 GB × CNY 0.00059 per GB per hour (equivalent to CNY 0.43 per GB per month) = CNY 0.01. Therefore, the user's total fee for this hour is CNY 0.02. If the user makes no requests during the next hour but the storage usage remains 20 GB, the fee for that hour is only the storage fee of CNY 0.01.
How to choose a billing method
For users with a stable request volume, the subscription method is more cost-effective. For example, with a 10 CU subscription instance, the compute resource cost is only CNY 1.50 per month. This provides a total of 10 × 3,600 × 24 × 30 = 25,920,000 CUs per month. In the pay-as-you-go model, the same number of CUs (25,920,000) would cost CNY 10.37. For users with a fluctuating request volume, the pay-as-you-go model can be more beneficial. With this model, you are not charged if you make no requests, so you do not pay for compute resources during idle periods.