influxdata / influxdata/influxdb
show tag values slow when auth-enabled
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
__System info:__ InfluxDB version 1.5.4, Amazon linux 2018.03, i3.2xlarge instance type, DB size ~1.1TB
Upgraded InfluxDB from 1.4.3 to 1.5.4 (used `influx_inspect buildtsi` to rebuild indexes). After that `show tag values` query became super slow when tag has high cardinality. After playing with different parameters in conf, turned out that `auth-enabled = true` makes it really slow.
__Steps to reproduce:__
2. Enable auth: `auth-enabled = true`
3. Run query:
```
[root@ip-10-0-0-1 ~]# time influx -username 'foo' -password 'bar' -database baz -execute "show tag values from cpu with key = host;" > output
real 0m22.601s
user 0m0.186s
sys 0m0.136s
[root@ip-10-0-0-1 ~]# wc -l output
30369 output
[root@ip-10-0-0-1 ~]#
```
4. Disable auth: `auth-enabled = false`
5. Run query:
```
[root@ip-10-0-0-1 ~]# time influx -database baz -execute "show tag values from cpu with key = host;" > output
real 0m0.462s
user 0m0.194s
sys 0m0.112s
[root@ip-10-0-0-1 ~]# wc -l output
30369 output
[root@ip-10-0-0-1 ~]#
```
__Expected behavior:__ I would expect that authentication settings do not affect query performance.
__Actual behavior:__ Query became slow.
__Additional info:__ Full conf (`egrep -v "^\s*#|^$" /etc/influxdb/influxdb.conf`):
```
[meta]
dir = "/var/lib/influxdb/meta"
[data]
dir = "/var/lib/influxdb/data"
wal-dir = "/var/lib/influxdb/wal"
index-version = "tsi1"
cache-max-memory-size = "512m"
cache-snapshot-write-cold-duration = "10s"
compact-full-write-cold-duration = "24h"
max-index-log-file-size = "512k"
max-series-per-database = 0
max-values-per-tag = 1000000
[coordinator]
write-timeout = "5s"
query-timeout = "30s"
[retention]
[shard-precreation]
[monitor]
[http]
auth-enabled = true
pprof-enabled = true
[ifql]
enabled = false
[logging]
[subscriber]
[[graphite]]
[[collectd]]
[[opentsdb]]
[[udp]]
[continuous_queries]
```
Contributor guide
Assessment
This issue has not been assessed yet.