I am relatively new to time series db world . I am running a Influxdb 1.8.x as a docker container, and I have configured the influxdb.conf file as a default config. Currently I am facing a issue of high CPU usage by influxdb, the CPU jumps to 80 to 90% and creating a problem for other process running on same machine. I have tried a solution given here ->> Influx high CPU issue but unfortunately It did not work? I am unable to understand the reason behind the issue and also struggling to get support in terms of documentation or community help. What I have tried so far:
SHOW SERIES CARDINALITY
and it looks well within limits--9400(I am also not sure about the ideal number for high cardinality red flag)I am looking for an approach, which will help me understand this problem the root cause?
Please let me know if you need any further information on same.
After reading about Influxdb debug and CPU profiling HTTP API influxdb I was able to pin-down the issue, the problem was in the way I was making the query, my query involved more complex functions and also GROUP BAY
tag.I also tried query analysis using EXPLAIN ANALYZE (query)
command to check how much time a query is taking to execute. I resolved that and noticed a huge Improvement in CPU load.
Basically I can suggest the following:
curl -o <file name> http://localhost:8086/debug/pprof/all?cpu=true e
and collect result.SHOW SERIES CARDINALITY
and EXPLAIN ANALYZE <query>
to understand the execution of the query