Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

influx-proxy占用内存非常大,导致服务器卡顿 #120

Open
wangxiaoyue09 opened this issue Nov 10, 2021 · 3 comments
Open

influx-proxy占用内存非常大,导致服务器卡顿 #120

wangxiaoyue09 opened this issue Nov 10, 2021 · 3 comments

Comments

@wangxiaoyue09
Copy link

之前使用单点influxdb时一般占用内存也就30多G,换成influx-proxy后两个cluster占用内存达到120G,请问有什么好的优化方案吗?

@chengshiwen
Copy link

看看influxdb的配置index-version是不是inmem,这个是采用基于内存的索引,会尽可能的使用内存

@wangxiaoyue09
Copy link
Author

index-version配置的"tsi1",配置文件如下:
reporting-disabled = true # 禁用报告,默认为 false
bind-address = ":8088"
[meta]
dir = "/opt/influxdb_new/data1/meta" # 元信息目录

[data]
dir = "/opt/influxdb_new/data1/data" # 数据目录
wal-dir = "/opt/influxdb_new/data1/wal" # 预写目录
wal-fsync-delay = "10ms" # SSD 设置为 0s,非 SSD 推荐设置为 0ms-100ms
index-version = "tsi1" # tsi1 磁盘索引,inmem 内存索引需要大量内存
query-log-enabled = true # 查询的日志,默认是 true
cache-max-memory-size = "8g"
[coordinator]
write-timeout = "20s" # 写入请求超时时间,默认为 10s
[http]
enabled = true
bind-address = ":8086"
auth-enabled = true
log-enabled = false # http 请求日志,默认是 true
[logging]
level = "info" # 日志等级,error、warn、info(默认)、debug
[monitor]
store-enabled = false
麻烦大佬帮忙看看是配置有哪块可以优化的吗?

@chengshiwen
Copy link

chengshiwen commented Jan 5, 2022

@wangxiaoyue09index-version=tsi1"情况下,影响内存的是cache-max-memory-size=8g,这个参数的含义是每个shard都会再申请至多8g的内存,有多少shards可以通过执行show shards查看,也可以通过看/path/to/influxdb/data/<database>/<retention_policy>/<shard_id>有多少个shard_id,如果希望减少内存,需要把减少cache-max-memory-size,例如1g(默认值)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants