Skip to main content
Version: 2.3.x

CnosDB vs InfluxDB

We use tsdb-comparisons test tool to test two products.

CnosDB 2.3.0 vs InfluxDB 1.8.10​

A comparison of written performance tests was made between CnosDB 2.3.0 and [InfluxDB 1.8.10] (https://github.com/influxdata/influxdb) followed by the test conclusions and test details.

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.

Pre-test​

1. Test Environment Preparedness​

CnosDBInfluxDB
Version2.3.01.8.10
Machine11
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-core Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz32-core Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz
Memory256G256G
Disk1 SDD (1T)1 SDD (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 corresponding machine's db environment, go environment, etc. in advance to ensure that you can connect properly.

  2. Install CnosDB:

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

  3. Test InfluxDB writes

    Reference: [InfluxDB 1.8.10] (https://github.com/influxdata/influxdb)

3) Configuration Check & Modify​

CnosDB and InfluxDB only modified the storage folder paths for Data, Wal, 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. Start CnosDB
docker run --name cnosdb -p 8902:8902 -d --cpus=8 --memory=32g cnosdb/cnosdb:community-latest
  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​

CnosDBInfluxDBPerformance Multiples
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