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

High cpu usage when checking series cardinality #8694

Closed
dazoot opened this issue Aug 14, 2017 · 4 comments
Closed

High cpu usage when checking series cardinality #8694

dazoot opened this issue Aug 14, 2017 · 4 comments

Comments

@dazoot
Copy link

dazoot commented Aug 14, 2017

We have been using influx for over a year. The number of series we have in DB is about 110 mil. We have one database: graphite, with a 1 year retention policy. The number of queries is not that high. We see consistent CPU usage even if there is no read query being ran on the server. We have upgraded to latest influxdb version and TSI indexes.

Server is quite big:
Dual Hexa Core
256 GB of Ram.

cpu-pinpoint 1468133712 1502693712

@jwilder
Copy link
Contributor

jwilder commented Aug 14, 2017

Can you run the following when cpu usage is high and attach the output to the issue?

curl -o profiles.tar.gz "http://localhost:8086/debug/pprof/all?cpu=true"

curl -o vars.txt "http://localhost:8086/debug/vars"
iostat -xd 1 30 > iostat.txt

@jwilder jwilder changed the title Very high cpu usage High cpu usage when checking series cardinality Aug 15, 2017
@jwilder
Copy link
Contributor

jwilder commented Aug 15, 2017

@dazoot It looks like the CPU usage is due to some the series cardinality monitoring checks that are expensive in your env. Your shards appear to be inmem and the monitoring calls are spending a lot of time sorting measurement and tag keys as well as allocating quite a bit of garbage. I have a potential fix that should reduce CPU usage for you a bit in #8702. If you are able to test that out and see if it helps, that would be great.

This is an issue specifically with inmem shards and won't occur with tsi shards.

@dazoot
Copy link
Author

dazoot commented Aug 15, 2017

Is there a way to migrate inmem to tsi ?

@jwilder
Copy link
Contributor

jwilder commented Aug 15, 2017

Switching the config setting will cause new shards to be created as tsi shards.

There is also a PR to add some offline tooling to convert existing shards to tsi: #8669.

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

No branches or pull requests

2 participants