Testing TDengine’s Vertical Scalability

Chait Diwadkar
Chait Diwadkar
/
Share on LinkedIn

Scaling vertically (or scaling up) refers to increasing hardware resources on an existing server. Ensuring that database management systems are vertically scalable and can make use of these new resources is not an easy task, requiring a well-designed framework with minimal resource consumption internally. Considering the large datasets typically processed by a time-series database, scaling up and scaling out are both essential capabilities.

To test whether TDengine is vertically scalable, we can construct an environment in which a specific hardware resource is the performance bottleneck of the system, and then gradually add resources to the system to see how performance is affected. In this article, the vertical scalability of TDengine will be tested in terms of CPU and disk resources.

Scaling Up CPU Cores

This test is intended to prove that, in a scenario where memory and disk resources cannot become bottlenecks, there is a direct relationship between the number of cores available to TDengine and the write speed of TDengine.

Methodology

In this test, TDengine 3.3.0.0 was deployed from the official Docker image on Docker Hub. A fixed number of cores were bound to the Docker container. The taosBenchmark tool was used to write data to TDengine using the smart meters schema described in the official documentation. The number of vgroups and write threads were both set to 4 initially, but when testing 5 or more cores, these parameters were increased to 12. This ensures that CPU resources remain the performance bottleneck.

The test data is described as follows:

  • Databases: 1
  • Supertables: 1
  • Subtables: 100
  • Rows per subtable: 1 million
  • Total records: 100 million

Results

CPU CoresVgroupsWrite ThreadsWrite Speed
(Rows per Second)
Disk I/O
(MBps)
Available Memory
(GB)
CPU Usage
144380,0001320096%
244880,0003620095%
3441,480,0004519895%
4441,930,0006019388%
512122,450,0007310496%
612122,880,0008510494%
1212125,730,00016710290%

The disk drive in the test scenario was a solid-state disk (SSD) with a maximum throughput of 350 MBps, meaning that I/O resources were sufficient throughout the test. The server and client in the test scenario were run on the same machine, meaning that network bandwidth could not become a bottleneck.

Each time a core was added, write performance increased by approximately 500,000 rows per second. Disk I/O increased at approximately the same rate as write speed. From this it can be concluded that TDengine is vertically scalable in terms of CPU cores.

Scaling Up Disk Drives

This test is intended to prove that, in a scenario where CPU and memory resources cannot become bottlenecks, there is a direct relationship between the number of disks available to TDengine and the write speed of TDengine.

Methodology

In this test, TDengine 3.3.0.0 was deployed on Ubuntu 20.4 with 24 cores and 64 GB of RAM. 5400 RPM HDDs were mounted to this system in the same tier — relatively slow disks to ensure that disk I/O remained the bottleneck during this test. The taosBenchmark tool was used to write data to TDengine using the following schema:

ColumnsData TypeLength
1TIMESTAMP8
1DOUBLE8
1BIGINT8
5BINARY5000
3NCHAR2500

In this schema, each row of data occupies 32,524 bytes. These relatively large rows consume I/O resources faster.

The test data is described as follows:

  • Databases: 1
  • Vgroups: 16
  • Supertables: 1
  • Subtables: 100
  • Rows per subtable: 10,000
  • Total records: 1 million

taosBenchmark was additionally configured as follows:

  • Write threads: 16
  • Write method: parameter binding mode

Results

DisksCommitted ThreadsWrite Speed
(Rows per Second)
CPU UsageDisk I/O
(MBps)
1410245%80–90
24192911%150–190
38409819%380–450

The 24-core CPU used in the test environment was mostly idle throughout the tests, meaning that compute resources were sufficient. The server and client in the test scenario were run on the same machine, meaning that network bandwidth could not become a bottleneck.

It was necessary to increase the number of committed threads once three disks are mounted to ensure that I/O performance remains the bottleneck. Committed threads are the threads used to write data to disk.

Each time a disk was mounted, write performance increased linearly and the new disk was used fully. From this it can be concluded that TDengine is vertically scalable in terms of disk drives.

  • Chait Diwadkar
    Chait Diwadkar

    Chait Diwadkar is Director of Solution Engineering at TDengine. Prior to joining TDengine he was in the biotechnology industry in technical marketing, professional services, and product management roles and supported customers in pharma, medical devices and diagnostics on analytical chemistry, and genetic platforms.