TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

prometheus remote_write to TDengine Performance is not as expected

Open showniu opened this issue 2 years ago • 3 comments

Performance Issue 我使用Prometheus的remote_write配置将数据写入TDengine、我的Prometheus数据每秒写入有138万、TDengine的写入速度只能在50K-60K徘徊。很难与Prometheus对标、谢谢帮我解答一下 😄

Problem Description Intel(R) Xeon(R) Gold 5318Y CPU @ 2.10GHz 96c 的TDengine的服务器 LOAD基本跑满、最好的效果也就是67、68K左右 目前看Tdengine的性能与Promehtues 的性能相差较大

Screenshots Prometheus的写入速度 image TDengine的写入速度 image

Environment (please complete the following information):

  • OS: [CentOS Linux release 7.9.2009]
  • TDengine Version [2.4.0.12]
  • prometheus的写入配置
remote_write:
  - url: "http://xx-2-10:6041/prometheus/v1/remote_write/prometheus_data"
    basic_auth:
      username: root
      password: taosdata

showniu avatar Mar 30 '22 07:03 showniu

增加每批次写入的记录数,可以大幅提升写入速度。

boxiaobj avatar Apr 01 '22 13:04 boxiaobj

@boxiaobj 如果再不修改 taosd 配置文件的情况下、将remote write的queue 改为较大值、将会出现 Max SQL Lenght 类的错误、当然我并没有尝试修改taosd的配置文件;我尝试将queue参数配置为TD默认配置能接受的最优配置、再大一点就会报错了。

remote_write:
...	
    queue_config:
      capacity: 1500
      max_samples_per_send: 500

这个配置使我的写入速度从60K 涨到了 67、68K的左右的水平;

值得注意的是我的CPU Load 已经满负荷了、不知道这个对写入有影响没有。 在同等配置下、同一个服务器、同样的监控数据;Prometheus 的写入最高可以达 260万。

showniu avatar Apr 02 '22 02:04 showniu

if any one who is using taosadapter for prometheus's remote_write purpose, i recommend they look into another open souce project called [VictoriaMetrics]

xujiesh0510 avatar Aug 07 '22 07:08 xujiesh0510