{"id":19381767,"url":"https://github.com/taosdata/timeseriesdatabase-comparisons","last_synced_at":"2026-01-14T19:49:16.966Z","repository":{"id":43445696,"uuid":"342436218","full_name":"taosdata/timeseriesdatabase-comparisons","owner":"taosdata","description":null,"archived":true,"fork":false,"pushed_at":"2022-03-02T03:13:27.000Z","size":223054,"stargazers_count":11,"open_issues_count":5,"forks_count":3,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-04-23T20:47:35.471Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taosdata.png","metadata":{"files":{"readme":"README zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-26T02:10:54.000Z","updated_at":"2025-02-19T18:05:30.000Z","dependencies_parsed_at":"2022-08-24T06:20:36.601Z","dependency_job_id":null,"html_url":"https://github.com/taosdata/timeseriesdatabase-comparisons","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/taosdata/timeseriesdatabase-comparisons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taosdata%2Ftimeseriesdatabase-comparisons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taosdata%2Ftimeseriesdatabase-comparisons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taosdata%2Ftimeseriesdatabase-comparisons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taosdata%2Ftimeseriesdatabase-comparisons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taosdata","download_url":"https://codeload.github.com/taosdata/timeseriesdatabase-comparisons/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taosdata%2Ftimeseriesdatabase-comparisons/sbom","scorecard":{"id":868311,"data":{"date":"2025-08-11","repo":{"name":"github.com/taosdata/timeseriesdatabase-comparisons","commit":"e7a041fcd2c5673132e2fc0a93a99b43a8c71ae8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: goCommand not pinned by hash: build/tsdbcompare/compilation.sh:9","Warn: goCommand not pinned by hash: build/tsdbcompare/compilation.sh:10","Warn: goCommand not pinned by hash: build/tsdbcompare/compilation.sh:11","Warn: goCommand not pinned by hash: build/tsdbcompare/compilation.sh:12","Warn: goCommand not pinned by hash: build/tsdbcompare/compilation.sh:13","Info:   0 out of   5 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":5,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'master'","Warn: 'stale review dismissal' is disabled on branch 'master'","Warn: required approving review count is 1 on branch 'master'","Warn: codeowners review is required - but no codeowners file found in repo","Warn: 'last push approval' is disabled on branch 'master'","Warn: no status checks found to merge onto branch 'master'","Info: PRs are required in order to make changes on branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-2605 / GHSA-m7wr-2xf7-cm9p","Warn: Project is vulnerable to: GO-2024-2606 / GHSA-mrww-27vc-gghv","Warn: Project is vulnerable to: GO-2022-0355 / GHSA-fx95-883v-4q4h"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T03:23:27.349Z","repository_id":43445696,"created_at":"2025-08-24T03:23:27.350Z","updated_at":"2025-08-24T03:23:27.350Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28433093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T09:18:18.857Z","updated_at":"2026-01-14T19:49:16.931Z","avatar_url":"https://github.com/taosdata.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InflxuDB和TDengine的性能对比测试工具\n\n### 前言\n[TDengine开源项目](https://github.com/taosdata/TDengine)里已经包含了性能对比测试的工具源代码。[https://github.com/taosdata/TDengine/tests/comparisonTest](https://github.com/taosdata/TDengine/tree/develop/tests/comparisonTest)，并基于这个开源的测试工具开展了[TDengine和InfluxDB对比测试](https://www.taosdata.com/blog/2019/07/19/tdengine与influxdb对比测试/)，[TDengine和OpenTSDB对比测试](https://www.taosdata.com/blog/2019/08/21/tdengine与opentsdb对比测试/),[TDengine和Cassandra对比测试](https://www.taosdata.com/blog/2019/08/14/tdengine与cassandra对比测试/)等一系列性能对比测试。为了更客观的对比TDengine和其他时序数据库的性能差异，本项目采用由InfluxDB团队开源的性能对比测试工具来进行对比测试，相同的数据产生器，相同的测试用例，相同的测试方法，以保证测试的客观公平。\n\n### 简介\n本项目是基于InfluxDB发布的一个[性能对比测试项目](https://github.com/influxdata/influxdb-comparisons)的基础上开发的。数据产生模块可以模拟Devops场景下多台服务器产生大量监控数据。数据写入程序可以根据不同的数据库格式，将产生的模拟数据以不同的格式写入到不同数据库里，以测试写入性能。查询模块以相同的查询类型产生相同的查询任务，以各数据库自己的格式进行查询，并统计查询消耗的时间，来测试查询性能。\n\n为了让测试过程更简单，本测试采用Docker容器方式来测试，所有被测的数据库都以容器的方式，从Dockerhub拉取下来，并设定固定的IP地址运行，便于脚本执行。容器镜像都是公开发布的，能保证测试的公平公正。\n\n本测试项目目前支持以下时序数据库的对比测试\n+ InfluxDB\n+ TDengine\n\n本项目的Github链接：https://github.com/liu0x54/timeseriesdatabase-comparisons\n## 前提条件\n为了开展测试，需要准备以下条件\n- 一台linux服务器，包含10GB的空闲硬盘空间，用于存储产生的测试数据。因为测试模拟数据先生成并写入硬盘文件，由数据加载程序从文件中读取一条条的数据写入语句，写入时序数据库。这种方式能够将数据产生过程中的性能差异排除。\n- root权限。测试过程需要用root权限来安装一个TDengine的客户端驱动，用于TDengine数据加载程序的调用。TDengine数据写入采用go语言调用C语言连接器的方式。\n\n## 准备测试\n\n先从[下载地址](http://www.taosdata.com/download/tsdbcompare.tar.gz)下载我们已经制作好的测试工具包，解压到本地。\n```sh\ntar -zxf tsdbcompare.tar.gz\n```\n解压后的目录结构如下:\n```sh\n.\n├── bin\n│   ├── bulk_data_gen\n│   ├── bulk_load_influx\n│   ├── bulk_load_tdengine\n│   ├── bulk_query_gen\n│   ├── query_benchmarker_influxdb\n│   └── query_benchmarker_tdengine\n├── config\n│   ├── TDDashboardSchema.toml\n│   └── TDengineSchema.toml\n├── data\n├── prepare.sh\n├── run.sh\n└── TDengine-client-1.6.4.5.tar.gz\n```\n`bin` 目录里是提前编译好的可执行文件，包括数据产生，数据加载，查询产生和查询加载。提前编译好方便大家下载即可用；如果有兴趣的同学也可以自己从源文件编译。源文件位于`cmd`下面的各个子目录里。可以自行编译后替换bin目录的文件。 \n\n`config` 目录里是TDengine写入数据需要用到的schema配置文件，模拟数据产生的数据通过schema配置里的信息可以知道该往哪个表里存。\n\n`data` 目录是用来存储测试过程中产生的数据文件。本测试采用先产生模拟数据，并将模拟数据按各数据库的写入格式写到文件里，再用加载程序从文件里读取按格式写好的语句往各数据库里加载的方式来开展测试。这样的方法，能够将原始数据转换成不同的格式的过程带来的差异进行屏蔽，更纯粹的对比数据库的写入性能。\n\n`prepare.sh` 是用来准备测试环境的脚本，包含三部分，1.安装docker程序，2.安装TDengine的客户端，3.拉取influxDB和TDengine的Docker镜像。\n```sh\n#!/bin/bash\nset -x\n\n#install docker\ncurl -fsSL https://get.docker.com -o get-docker.sh\nsudo sh get-docker.sh\n\n\n#install tdengine client\ntar -zxf TDengine-client-1.6.4.5.tar.gz\ncd TDengine-client-1.6.4.5\n./install_client.sh\ncd ..\n\n#pull influxdb and tdengine docker images\ndocker pull influxdb \ndocker pull tdengine/tdengine:v1.6.4.5.c \n```\n如果目标系统上已经安装了docker程序，就不用执行这个`prepare.sh`脚本了，可以直接按脚本里的第二、三部分去安装TDengine Client和拉取对应的Docker镜像。\n\n在上面的步骤都执行完成，并确认成功后，可以开展测试工作了。\n\n## 开展测试\n\n在整个测试过程中，建议另开一个终端，运行top，查看系统的CPU和内存占用情况\n```sh\ntop\n```\n\n### 写入测试\n本测试包提供了一个`run.sh`脚本，自动执行将docker容器按指定IP地址运行起来，然后产生数据，写入数据文件，并写入时序数据库。\n数据产生和写入由以下两条命令完成\n```sh\n#产生模拟数据并写入数据文件\nbin/bulk_data_gen -seed 123 -format influx-bulk -sampling-interval 1s -scale-var 10 -use-case devops -timestamp-start \"2018-01-01T00:00:00Z\" -timestamp-end \"2018-01-02T00:00:00Z\" \u003edata/influx.dat\nbin/bulk_data_gen -seed 123 -format tdengine -sampling-interval 1s -tdschema-file config/TDengineSchema.toml -scale-var 10 -use-case devops -timestamp-start \"2018-01-01T00:00:00Z\" -timestamp-end \"2018-01-02T00:00:00Z\"  \u003e data/tdengine.dat\n```\n解释一下以上的命令：按influxDB/TDengine的格式，以1秒一条数据的产生频率，模拟10台设备，以devops场景产生24小时的数据，并写入influx.dat文件。\nDevops模型下，一台服务器会产生9类数据，分别是cpu，disk，mem，等，因此总共会产生7776000条数据记录。\n数据文件完成后，就开始数据写入测试：\n```sh\n#数据写入数据库\ncat data/influx.dat  |bin/bulk_load_influx --batch-size=5000 --workers=20 --urls=\"http://172.15.1.5:8086\" \n\ncat data/tdengine.dat |bin/bulk_load_tdengine --url 172.15.1.6:0 --batch-size 300   -do-load -report-tags n1 -workers 20 -fileout=false \n```\n上面命令的含义是以每批次写入5000/300条记录，分20个线程，将数据文件读取出来后写入influxDB/TDengine中\n### 查询测试\n在完成写入后，就开始查询测试。\n查询测试设定了四个查询用例的语句，每个查询语句都执行1000遍，然后统计总的查询用时:\n1. 测试用例1，查询所有数据中，用8个hostname标签进行匹配，匹配出这8个hostname对应的模拟服务器CPU数据中的usage_user这个监控数据的最大值。\n```sh\n#TDengine\nbin/bulk_query_gen  -seed 123 -format tdengine -query-type 8-host-all -scale-var 10 -queries 1000 | bin/query_benchmarker_tdengine  -urls=\"http://172.15.1.6:6020\" -workers 50 -print-interval 0\n\n#InfluxDB\nbin/bulk_query_gen  -seed 123 -format influx-http -query-type 8-host-all -scale-var 10 -queries 1000 | bin/query_benchmarker_influxdb  -urls=\"http://172.15.1.5:8086\"  -workers 50 -print-interval 0\n```\n2. 测试用例2，查询所有数据中，用8个hostname标签进行匹配，匹配出这8个hostname对应的模拟服务器CPU数据中的usage_user这个监控数据，以1小时为粒度，查询每1小时的最大值。\n```sh\n#TDengine\nbin/bulk_query_gen  -seed 123 -format tdengine -query-type 8-host-allbyhr -scale-var 10 -queries 1000 | bin/query_benchmarker_tdengine  -urls=\"http://172.15.1.6:6020\" -workers 50 -print-interval 0\n\n#InfluxDB\nbin/bulk_query_gen  -seed 123 -format influx-http -query-type 8-host-allbyhr -scale-var 10 -queries 1000 | bin/query_benchmarker_influxdb  -urls=\"http://172.15.1.5:8086\"  -workers 50 -print-interval 0\n```\n3. 测试用例3，随机查询12个小时的数据，用8个hostname标签进行匹配，匹配出这8个hostname对应的模拟服务器CPU数据中的usage_user这个监控数据，以10分钟为粒度，查询每10分钟的最大值。\n```sh\n#TDengine\nbin/bulk_query_gen  -seed 123 -format tdengine -query-type 8-host-12-hr -scale-var 10 -queries 1000 | bin/query_benchmarker_tdengine  -urls=\"http://172.15.1.6:6020\" -workers 50 -print-interval 0\n\n#InfluxDB\nbin/bulk_query_gen  -seed 123 -format influx-http -query-type 8-host-12-hr -scale-var 10 -queries 1000 | bin/query_benchmarker_influxdb  -urls=\"http://172.15.1.5:8086\"  -workers 50 -print-interval 0\n```\n4. 测试用例4，随机查询1个小时的数据，用8个hostname标签进行匹配，匹配出这8个hostname对应的模拟服务器CPU数据中的usage_user这个监控数据，以1分钟为粒度，查询每1分钟的最大值。\n```sh\n#TDengine\nbin/bulk_query_gen  -seed 123 -format tdengine -query-type 8-host-1-hr -scale-var 10 -queries 1000 | bin/query_benchmarker_tdengine  -urls=\"http://172.15.1.6:6020\" -workers 50 -print-interval 0\n\n#InfluxDB\nbin/bulk_query_gen  -seed 123 -format influx-http -query-type 8-host-1-hr -scale-var 10 -queries 1000 | bin/query_benchmarker_influxdb  -urls=\"http://172.15.1.5:8086\"  -workers 50 -print-interval 0\n```\n查询过程结束后，将测试结果以以下格式打印出来\n\n```\n======================================================\n             tsdb performance comparision             \n======================================================\n       Writing 7776000 records test takes:          \n       InfluxDB           |       95.00 Seconds    \n       TDengine           |       25.12 Seconds    \n------------------------------------------------------\n                   Query test cases:                \n case 1: select the max(value) from all data    \n filtered out 8 hosts                                 \n       Query test case 1 takes:                      \n       InfluxDB           |       82.51 Seconds    \n       TDengine           |       1.01 Seconds    \n------------------------------------------------------\n case 2: select the max(value) from all data          \n filtered out 8 hosts with an interval of 1 hour     \n case 2 takes:                                       \n       InfluxDB           |       102.99 Seconds    \n       TDengine           |       12.02 Seconds    \n------------------------------------------------------\n case 3: select the max(value) from random 12 hours\n data filtered out 8 hosts with an interval of 10 min         \n filtered out 8 hosts interval(1h)                   \n case 3 takes:                                       \n       InfluxDB           |       42.66 Seconds    \n       TDengine           |       6.72 Seconds    \n------------------------------------------------------\n case 4: select the max(value) from random 1 hour data  \n data filtered out 8 hosts with an interval of 1 min         \n case 4 takes:                                        \n       InfluxDB           |       5.17 Seconds    \n       TDengine           |       1.98 Seconds    \n------------------------------------------------------\n```\n## 结果分析\n通过本测试包产生的数据和相关的写入、查询用例测试可以看出，TDengine在性能上相比InfluxDB有较大的优势。\n细致分析下来可以有以下结论：\n- 写入性能：相同数据源InfluxDB写入用时约是TDengine的4倍\n- 全部数据聚合计算查询：InfluxDB查询用时约为TDengine的80倍\n- 全部数据聚合计算查询以小时为颗粒聚合结果：InfluxDB查询用时约为TDengine的10倍\n- 随机选取12小时的数据聚合计算查询以10分钟为颗粒聚合结果：InfluxDB用时约为TDengine的6倍\n- 随机选取1小时的数据聚合计算查询以1分钟为颗粒聚合结果：InfluxDB用时约为TDengine的2.5倍\n\n通过top命令的观察，我们可以看到，测试用例执行时，InfluxDB的CPU占用率基本达到满负荷，以4核CPU的服务器为例，经常达到390%以上；而TDengine的CPU占用率则低很多。\n\n## 从源文件编译\n本项目中的二进制程序是基于1.6.4.5版本的TDengine编译的，因为要用到TDengine的客户端，而TDengine客户端版本必须和TDengine的服务端的版本必须匹配，因此直接使用本项目的二进制的程序连接其他版本的TDengine或镜像时，会遇到连接不上的问题。\n如果遇到这种情况，或者对于从源代码编译二进制文件感兴趣的使用者，就需要从本项目的源代码编译出二进制代码后再运行本测试程序。下面介绍编译的步骤\n\n#### 前提条件\n- 获取目标版本的TDengine，在编译所在的机器上安装和服务端一样的TDengine服务端版本。TDengine服务端版本可以是从源代码编译出来的，也可以是从Taosdata官网获取的编译好的安装包\n- 如果是从源代码编译的TDengine，注意编译出来的lib文件，以及源代码中的taos.h文件必须放到系统的目录里，这样才能正确被引用。可以参考以下代码，将lib文件和taos.h文件放到系统目录里去。如果是从安装包安装的话，可以跳过这一步：\n```\ncp  (TDengine项目的build和源代码目录所在的路径)/build/build/lib/libtaos.so /usr/lib/libtaos.so.1\nln -s /usr/lib/libtaos.so.1 /usr/lib/libtaos.so\ncp (TDengine项目的build和源代码目录所在的路径)/TDengine/src/inc/taos.h /usr/include/\n```\n\n- 安装最新版本的golang语言程序,参考golang网站相关指导页面[下载安装golang](https://golang.org/dl/)\n\n#### 开始编译\n进入本项目的cmd目录，这个目录下就是各个可执行程序的源文件目录。\n其中：\nbulk_data_gen 目录中的main.go是生成测试所需的数据的程序\nbulk_load_* 是针对不同数据库写入数据的程序\nbulk_query_gen 目录中的main.go是生成测试所需的查询语句程序\nquery_benchmarker_* 是针对不同数据库的查询测试执行程序\n\n因此，如果要测试TDengine，就编译以下目录中的main.go文件：\nbulk_data_gen\nbulk_load_tdengine\nbulk_query_gen\nquery_benchmarker_tdengine\n\n编译方法如下：\n进入对应的文件路径下，执行：\n```\ngo build\n```\n顺利的话就回生成一个可执行的二进制文件，名称为该文件夹的名称\n```\nTomdeMacBook-Pro:bulk_data_gen tom$ go build\nTomdeMacBook-Pro:bulk_data_gen tom$ ls\nbulk_data_gen   main.go\nTomdeMacBook-Pro:bulk_data_gen tom$ \n```\n如果遇到某些引用的包没有找到的话，可以使用go get对应的包，获取到本地后再编译。\n比如如果找不到github.com/taosdata/TDengine/src/connector/go/src/taosSql，那么执行\n```\ngo get github.com/taosdata/TDengine/src/connector/go/src/taosSql\n```\n在以上语句执行成功后就可以继续编译了。\n\n编译出二进制代码后，就可以参考run.sh脚本中的命令顺序，手动执行测试了。\n\n## 命令参数详解\n测试程序需要输入对应的参数，必须在正确理解了参数的含义的基础上，正确的设置参数，再执行测试程序。对于每个参数的含义如下\n#### bulk_data_gen程序用到的参数\n```\nUsage of ./bulk_data_gen:\n  -config-file string\n        Simulator config file in TOML format (experimental) \n        说明：这个参数暂时用不上，可以不用管\n  -cpu-profile file\n        Write CPU profile to file\n        说明：这个参数暂时用不上，可以不用管\n  -debug int\n        Debug printing (choices: 0, 1, 2) (default 0).\n        说明：这个参数暂时用不上，可以不用管\n  -format string\n        Format to emit. (choices: influx-bulk, es-bulk, es-bulk6x, cassandra, mongo, opentsdb, timescaledb-sql, timescaledb-copyFrom, graphite-line, splunk-json, tdengine) (default \"influx-bulk\")\n        说明：这个参数设置测试数据输出的格式，可以输入choices后面的选项，如果要生成TDengine的测试数据，就带tdengine\n  -interleaved-generation-group-id uint\n        Group (0-indexed) to perform round-robin serialization within. Use this to scale up data generation to multiple processes.\n        说明：这个参数暂时用不上，可以不用管\n  -interleaved-generation-groups uint\n        The number of round-robin serialization groups. Use this to scale up data generation to multiple processes. (default 1)\n        说明：这个参数暂时用不上，可以不用管\n  -sampling-interval duration\n        Simulated sampling interval. (default 10s)\n        说明：这个参数设置模拟数据产生的时间戳的间隔，缺省10秒钟。\n  -scale-var int\n        Scaling variable specific to the use case. (default 1)\n        说明：这个参数设置数据源的数量，如果为N，则模拟N个数据源产生数据。这个数量越大，相同条件下产生的数据量越大\n  -scale-var-offset int\n        Scaling variable offset specific to the use case.\n        说明：这个参数设置的数据源的ID的偏移量，在多个程序同时产生模拟数据时，通过这个偏移量来区别每个测试程序产生的数据中的ID信息，避免重叠\n  -seed int\n        PRNG seed (default, or 0, uses the current timestamp).\n        说明：这个是模拟数据的伪随机数种子，测试不同数据库时，这个种子建议设置成一样的，那么在相同的配置下，产生的数据值也是一致的\n  -tdschema-file string\n        TDengine schema config file in TOML format (experimental)\n        说明：这个参数设置TDengine需要的配置文件的路径，TDengine需要配置文件来生成对应的表结构。本项目中用到了两个配置文件，分别是TDengineSchema.toml和TDDashboardSchema.toml,\n        对于use-case是devops，iot时，请指定TDengineSchema.toml作为配置文件；对于use-case是dashboard时，请指定TDDashboardSchema.toml作为配置文件\n  -timestamp-end string\n        Ending timestamp (RFC3339). (default \"2018-01-02T00:00:00Z\")\n        说明：模拟的测试数据时间戳结束的时间\n  -timestamp-start string\n        Beginning timestamp (RFC3339). (default \"2018-01-01T00:00:00Z\")\n        说明：模拟的测试数据时间戳开始的时间\n  -use-case string\n        Use case to model. (choices: devops, iot, dashboard) (default \"devops\")\n        说明：选择测试数据模型，不同的use-case模拟了不同的数据类型。\n```\n#### bulk_load_tdengine程序用到的参数\n```\nUsage of ./bulk_load_tdengine:\n-batch-size int\n        Batch size (input items). (default 100)\n        说明：每次写入请求中向TDengine写入的记录数量，缺省为100条记录\n  -do-load\n        Whether to read data from file or from stand input. Set this flag to true to get input from file.\n        说明：选择测试数据来源，是从文件中读取，还是从stdin中获取。如果设为true，则从文件中读取数据\n  -file string\n        Input file\n        说明：如果-do-load设为true，则通过这个参数设定数据文件的路径\n  -fileout\n        if file out, will out put sql into file (default true)\n        说明：如果设为true则不直接写数据库，而是将指令写到指定文件中，便于分析\n  -report-database string\n        Database name where to store result metrics (default \"vehicle\")\n        说明：设定写入目标数据库中的database名称\n  -report-host string\n        Host to send result metrics\n        说明：报告测试结果的服务器，暂时用不上\n  -report-password string\n        User password for Host to send result metrics\n        说明：报告测试结果的服务器，暂时用不上\n  -report-tags string\n        Comma separated k:v tags to send  alongside result metrics (default \"node1\")\n         说明：不用填，用缺省值即可\n  -report-user string\n        User for host to send result metrics\n         说明：不用填，用缺省值即可\n  -slavesource\n        if slave source, will not create database\n         说明：不用填，用缺省值即可\n  -url string\n        TDengine URL. (default \"127.0.0.1:0\")\n        说明：TDengine数据库的地址信息，以ip地址加:0作为格式，比如TDengine运行22.23.123.32这个服务器上，则这里填写 22.23.123.32:0\n  -use-case string\n        Use case to set specific load behavior. Options: devops,iot,dashboard (default \"devops\")\n        说明：不用填，用缺省值即可\n  -workers int\n        Number of parallel requests to make. (default 2)\n        说明：设定多个写入线程的数量，用缺省值，或者在写入速度较慢时可以适当调大\n```\n\n#### bulk_query_gen用到的参数\n```\nUsage of ./bulk_query_gen:\n  -document-format string\n        Document format specification. (for mongo format 'simpleArrays'; leave empty for previous behaviour)\n        说明：不用填，用缺省值即可\n  -format string\n        Format to emit. (Choices are in the use case matrix.) (default \"influx-http\")\n        说明：查询语句的格式，填对应的数据库，如果测TDengine，则填tdengine\n  -interleaved-generation-group-id uint\n        Group (0-indexed) to perform round-robin serialization within. Use this to scale up data generation to multiple processes.\n        说明：不用填，用缺省值即可\n  -interleaved-generation-groups uint\n        The number of round-robin serialization groups. Use this to scale up data generation to multiple processes. (default 1)\n        说明：不用填，用缺省值即可\n  -queries int\n        Number of queries to generate. (default 1000)\n        说明：测试查询的次数，可以填1000次，因为每次查询的时间非常短，可以填多次，测总的时间\n  -query-interval duration\n        Time interval query should ask for. (default 1h0m0s)\n        说明：不用填，用缺省值即可\n  -query-interval-type string\n        Interval type query { window - either random or shifted, last - interval is defined relative to now() } (default \"window\")\n        说明：不用填，用缺省值即可\n  -query-type string\n        Query type. (Choices are in the use case matrix.)\n        说明：查询TDengine的话，从下面的选项中选择format: tdengine的填入\n  -scale-var int\n        Scaling variable (must be the equal to the scale-var used for data generation). (default 1)\n        说明：这个参数和bulk_data_gen命令的参数保持一致，表示测试数据模型是模拟的多少个数据源产生的。这个数据会对查询语句中的设备ID产生影响\n  -seed int\n        PRNG seed (default, or 0, uses the current timestamp).\n        说明：查询语句中用到的伪随机数种子，如果测试不同的数据库，确保这个种子是一致的，这样的话查询语句中的随机值可以保证一致\n  -time-window-shift duration\n        Sliding time window shift. (When set to \u003e 0s, queries option is ignored - number of queries is calculated. (default -1ns)\n        说明：不用填，用缺省值即可\n  -timestamp-end string\n        Ending timestamp (RFC3339). (default \"2018-01-02T00:00:00Z\")\n        说明：不用填，用缺省值即可\n  -timestamp-start string\n        Beginning timestamp (RFC3339). (default \"2018-01-01T00:00:00Z\")\n        说明：不用填，用缺省值即可\n  -use-case string\n        Use case to model. (Choices are in the use case matrix.) (default \"devops\")\n        说明：查询TDengine的话，不用填，缺省devops\n The use case matrix of choices is:\n  use case: devops, query type: groupby, format: influx-http\n  use case: devops, query type: groupby, format: timescaledb\n  use case: devops, query type: groupby, format: graphite\n  use case: devops, query type: groupby, format: splunk\n  use case: devops, query type: groupby, format: cassandra\n  use case: devops, query type: groupby, format: es-http\n  use case: devops, query type: groupby, format: influx-flux-http\n  use case: devops, query type: 1-host-1-hr, format: cassandra\n  use case: devops, query type: 1-host-1-hr, format: es-http\n  use case: devops, query type: 1-host-1-hr, format: influx-http\n  use case: devops, query type: 1-host-1-hr, format: mongo\n  use case: devops, query type: 1-host-1-hr, format: graphite\n  use case: devops, query type: 1-host-1-hr, format: influx-flux-http\n  use case: devops, query type: 1-host-1-hr, format: opentsdb\n  use case: devops, query type: 1-host-1-hr, format: timescaledb\n  use case: devops, query type: 1-host-1-hr, format: splunk\n  use case: devops, query type: 1-host-1-hr, format: tdengine\n  use case: devops, query type: 1-host-12-hr, format: opentsdb\n  use case: devops, query type: 1-host-12-hr, format: graphite\n  use case: devops, query type: 1-host-12-hr, format: splunk\n  use case: devops, query type: 1-host-12-hr, format: cassandra\n  use case: devops, query type: 1-host-12-hr, format: influx-http\n  use case: devops, query type: 1-host-12-hr, format: mongo\n  use case: devops, query type: 1-host-12-hr, format: timescaledb\n  use case: devops, query type: 1-host-12-hr, format: tdengine\n  use case: devops, query type: 1-host-12-hr, format: es-http\n  use case: devops, query type: 1-host-12-hr, format: influx-flux-http\n  use case: devops, query type: 8-host-1-hr, format: opentsdb\n  use case: devops, query type: 8-host-1-hr, format: timescaledb\n  use case: devops, query type: 8-host-1-hr, format: es-http\n  use case: devops, query type: 8-host-1-hr, format: influx-flux-http\n  use case: devops, query type: 8-host-1-hr, format: influx-http\n  use case: devops, query type: 8-host-1-hr, format: mongo\n  use case: devops, query type: 8-host-1-hr, format: graphite\n  use case: devops, query type: 8-host-1-hr, format: splunk\n  use case: devops, query type: 8-host-1-hr, format: tdengine\n  use case: devops, query type: 8-host-1-hr, format: cassandra\n  use case: devops, query type: 8-host-12-hr, format: influx-http\n  use case: devops, query type: 8-host-12-hr, format: tdengine\n  use case: devops, query type: 8-host-allbyhr, format: influx-http\n  use case: devops, query type: 8-host-allbyhr, format: tdengine\n  use case: devops, query type: 8-host-all, format: influx-http\n  use case: devops, query type: 8-host-all, format: tdengine\n  use case: iot, query type: 1-home-12-hours, format: influx-flux-http\n  use case: iot, query type: 1-home-12-hours, format: influx-http\n  use case: iot, query type: 1-home-12-hours, format: timescaledb\n  use case: iot, query type: 1-home-12-hours, format: cassandra\n  use case: iot, query type: 1-home-12-hours, format: mongo\n  use case: dashboard, query type: disk-allocated, format: influx-http\n  use case: dashboard, query type: memory-utilization, format: influx-http\n  use case: dashboard, query type: queue-bytes, format: influx-http\n  use case: dashboard, query type: dashboard-all, format: influx-http\n  use case: dashboard, query type: cpu-num, format: influx-http\n  use case: dashboard, query type: disk-utilization, format: influx-http\n  use case: dashboard, query type: nginx-requests, format: influx-http\n  use case: dashboard, query type: throughput, format: influx-http\n  use case: dashboard, query type: http-request-duration, format: influx-http\n  use case: dashboard, query type: http-requests, format: influx-http\n  use case: dashboard, query type: kapa-cpu, format: influx-http\n  use case: dashboard, query type: redis-memory-utilization, format: influx-http\n  use case: dashboard, query type: kapa-ram, format: influx-http\n  use case: dashboard, query type: memory-total, format: influx-http\n  use case: dashboard, query type: system-load, format: influx-http\n  use case: dashboard, query type: availability, format: influx-http\n  use case: dashboard, query type: cpu-utilization, format: influx-http\n  use case: dashboard, query type: disk-usage, format: influx-http\n  use case: dashboard, query type: kapa-load, format: influx-http       \n\n```\n#### query_benchmarker_tdengine用到的参数\n```\nUsage of ./query_benchmarker_tdengine:\n  -batch-size int\n        Number of queries in batch per worker for Dashboard use-case (default 18)\n        说明：不用填，用缺省值即可\n  -benchmark-duration duration\n        Run querying continually for defined time interval, instead of stopping after all queries have been used\n        说明：不用填，用缺省值即可\n  -burn-in uint\n        Number of queries to ignore before collecting statistics.\n        说明：不用填，用缺省值即可\n  -client-index int\n        Index of a client host running this tool. Used to distribute load\n        说明：不用填，用缺省值即可\n  -debug int\n        Whether to print debug messages.\n        说明：不用填，用缺省值即可\n  -dial-timeout duration\n        TCP dial timeout. (default 15s)\n        说明：不用填，用缺省值即可\n  -file string\n        Input file\n        说明：不用填，用缺省值即可\n  -grad-workers-inc\n        Whether to gradually increase number of workers. The 'workers' params defines initial number of workers in this case.\n        说明：不用填，用缺省值即可\n  -grad-workers-max int\n        Maximum number of workers when are added gradually. (default -1)\n        说明：不用填，用缺省值即可\n  -http-client-type string\n        HTTP client type {fast, default} (default \"fast\")\n        说明：不用填，用缺省值即可\n  -increase-interval duration\n        Interval when number of workers will increase (default 30s)\n        说明：不用填，用缺省值即可\n  -limit int\n        Limit the number of queries to send. (default -1)\n        说明：不用填，用缺省值即可\n  -memprofile string\n        Write a memory profile to this file.\n        说明：不用填，用缺省值即可\n  -moving-average-interval duration\n        Interval of measuring mean response time on which moving average  is calculated. (default 30s)\n        说明：不用填，用缺省值即可\n  -notification-group string\n        Terminate message notification siblings (comma-separated host:port list of other query benchmarkers)\n        说明：不用填，用缺省值即可\n  -notification-port int\n        Listen port for remote notification messages. Used to remotely terminate benchmark (use -1 to disable it) (default -1)\n        说明：不用填，用缺省值即可\n  -notification-target string\n        host:port of finish message notification receiver\n        说明：不用填，用缺省值即可\n  -print-interval uint\n        Print timing stats to stderr after this many queries (0 to disable) (default 100)\n        说明：每隔多少条查询后打印一下中间结果，建议填0或者一个比较大的数，避免打印较多的信息\n  -print-responses\n        Pretty print JSON response bodies (for correctness checking) (default false).\n        说明：不用填，用缺省值即可\n  -read-timeout duration\n        TCP read timeout. (default 5m0s)\n        说明：不用填，用缺省值即可\n  -report-database string\n        Database name where to store result metrics. (default \"database_benchmarks\")\n        说明：不用填，用缺省值即可\n  -report-host string\n        Host to send result metrics.\n        说明：不用填，用缺省值即可\n  -report-password string\n        User password for Host to send result metrics.\n        说明：不用填，用缺省值即可\n  -report-tags string\n        Comma separated k:v tags to send  alongside result metrics.\n        说明：不用填，用缺省值即可\n  -report-telemetry\n        Whether to report also progress info about mean, moving mean and #workers.\n        说明：不用填，用缺省值即可\n  -report-user string\n        User for Host to send result metrics.\n        说明：不用填，用缺省值即可\n  -response-time-limit duration\n        Query response time limit, after which will client stop.\n        说明：不用填，用缺省值即可\n  -rt-trend-samples int\n        Number of avg response time samples used for linear regression (-1: number of samples equals increase-interval in seconds) (default -1)\n        说明：不用填，用缺省值即可\n  -telemetry-batch-size uint\n        Telemetry batch size (lines). (default 1)\n        说明：不用填，用缺省值即可\n  -telemetry-stderr\n        Whether to write telemetry also to stderr.\n        说明：不用填，用缺省值即可\n  -urls string\n        Daemon URLs, comma-separated. Will be used in a round-robin fashion. (default \"http://localhost:6020\")\n        说明：TDengine数据库的地址信息，以ip地址加tdengine的restful接口端口作为格式，比如TDengine运行22.23.123.32这个服务器上，则这里填写 http://22.23.123.32:6020\n  -use-case string\n        Enables use-case specific behavior. Empty for default behavior. Additional use-cases: dashboard\n        说明：不用填，用缺省值即可\n  -wait-interval duration\n        Delay between sending batches of queries in the dashboard use-case\n        说明：不用填，用缺省值即可\n  -workers int\n        Number of concurrent requests to make. (default 1)\n        说明：查询线程的数量，这个参数决定了查询执行函数会用多少个线程并行的去查询\n  -write-timeout duration\n        TCP write timeout. (default 5m0s)\n        说明：不用填，用缺省值即可\n```\n### 测试执行\n基于以上对每个测试程序参数的解释，可以对照run.sh里的测试语句进行理解和尝试","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaosdata%2Ftimeseriesdatabase-comparisons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaosdata%2Ftimeseriesdatabase-comparisons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaosdata%2Ftimeseriesdatabase-comparisons/lists"}