Skip to main content
Version: latest

Benchmark

To present CnosDB performance more intuitively, we do performance test of CnosDB and InfluxDB of the same time series database by using tsdb-comparisons.

Conclusion

When the batch-size is set to 20,000, InfluxDB returns an error on the client: {"error":"engine: cache-max-memory-size exceeded: (1074767264/1073741824)"}, So we did not test the performance of InfluxDB in this case, but you can see that CnosDB is better than InfluxDB in most scenarios.

Test CnosDB writes

Testing Environment

CnosDBInfluxDB
Version2.3.01.8.10
Machine1台1台
Configuration3.10.0-1160.81.1.el7.x86_643.10.0-1160.81.1.el7.x86_64
Operating System VersionCentOS Linux release 7.9.2009 (Core)CentOS Linux release 7.9.2009 (Core)
CPU32核 Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz32核 Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz
Memory256G256G
Disk1块SSD盘(1T)1块SSD盘(1T)

Note: CnosDB and InfluxDB are internal to the container, the CPU number is 8, and the memory limit is 32G.

2. Test case preparation

  1. Install the db environment, go environment, etc. of the corresponding machine in advance, and ensure normal connection.

  2. Install CnosDB:

    Refer to the deployment document: [Docker Install CnosDB] (../start/install. md)

  3. Test InfluxDB writes

    wget https://dl.influxdata.com/influxdb/releases/influxdb-1.8.10_linux_amd64.tar.gz tar xvfz influxdb-1.8.10_linux_amd64.tar.gz ./influxd run -config ../../etc/influxdb/influxdb.conf

3) Configuration Check & Modify

CnosDB and InfluxDB only modified the storage folder paths for Data, Wall, and Meta, while keeping the rest as default. This will not be repeated here.

4. Dataset preparation

UsageDetermine the PRNG-seedNumber of devices to generateStart timestampEnd timestampInterval between readings per deviceTarget databaseData SizeRows
iot1231002023-01-01T00:00:00Z2023-05-01T00:00:00Z50sCnosDB8G37,342,964
iot1231002023-01-01T00:00:00Z2023-05-01T00:00:00Z50sInfluxDB8G37,342,964

5. Test Scheme

This test program looks primarily at: to keep the same batch-size below from two angles and tests to import and distribute; keep the same import and dispatch size; test batch-size.

batch-sizeworkers
100030
300030
300010
50008
200008

Test medium term

  1. Tsdb-comparisons generate data
git clone https://github.com/cnosdb/cnosdb.git
  1. Generate InfluxDB Dataset
generate_data --use-case="iot" --seed=123 --scale=4000 --timestamp-start="2022-01-01T00:00:00Z" --timestamp-end="2022-02-01T00:00:00Z" --log-interval="10s" --format="influxdb"gzip > /tmp/influxdb-data.gz
  1. www.cnosdb.com
docker run --name cnosdb -p 8902:8902 -d --cpus=8 --memory=32g cnosdb/cnosdb:community-latest cnosdb run -M singleton
  1. InfluxDB is the default configuration except [data] and [meta]
docker run --name influxdb -p 8086:8086 -d --cpus=8 --memory=32g influxdb
  1. The configuration of the CosDB is as follows:
cd tsdb-comparisons/cmd/load_cnosdb
go build
./load_cnosdb --do-abort-on-exist=false --do-create-db=false --gzip=false --file=<file_path>/data.txt --db-name=<db_name> --urls="http://<ip>:8902" --batch-size=<batch_size_num> --workers=<workers_num>
  1. Download InfluxDB, modify configurations in etc/influxdb/influxdb.conf, run
cd tsdb-comparisons/cmd/load_cnosdb
go build
./load_influx --do-abort-on-exist=false --do-create-db=false --gzip=false --file=<file_path>/data.txt --db-name=<db_name> --urls="http://<ip>:8086" --batch-size=<batch_size_num> --workers=<workers_num>

Test Results

CnosDBInfluxDBWith the increase of concurrent numbers, performance in some scenarios will also be improved, and CnosDB performance has a higher ceiling.
batch-sizeworkersoverall row/soverall metric/soverall row/soverall metric/s
100030102089.67807526.6693781.54741809.551.08
300030137468.171087369.62106206.98840094.401.29
300010211845.941675695.81158378.111252766.681.33
50008176883.431399143.30162338.481284093.141.08
200008174757.781382329.47160626.451270551.001.08