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

Question: Upper limit for tags #3471

Closed
shilpisharma opened this issue Jul 27, 2015 · 11 comments
Closed

Question: Upper limit for tags #3471

shilpisharma opened this issue Jul 27, 2015 · 11 comments

Comments

@shilpisharma
Copy link

I have a small question. Is there an upper limit to how many tags we can add in InfluxDB?

@desa
Copy link
Contributor

desa commented Jul 27, 2015

From the docs

As a rule of thumb, keep tag cardinality below 100,000. The limit will vary depending on the resources available to InfluxDB, but it is best to keep tag cardinality as low as possible. If you have a value in your data with high cardinality, it should probably be a field, not a tag.

@desa desa closed this as completed Jul 27, 2015
@beckettsean
Copy link
Contributor

The 100k number is very rough. If you stay below that you should be fine. With tag cardinality in the millions schema and query design become more important, as it becomes easier to create poor performance situations.

We will document this more extensively as performance testing matures.

@kotwal13aditya
Copy link

An extension to the question: is there a limit to the length of a tag?

@beckettsean
Copy link
Contributor

Not really. There used to be a 64k limit but that was removed with the TSM engine. I suspect 4GB would be the limit now, but anything above a few thousand KB seems like a bad idea, just for throughput concerns.

Remember, the full uncompressed tag set lives in memory as the index. No better way to chew up RAM than with 10KB tag names and values.

@kotwal13aditya
Copy link

Thanks @beckettsean

@elvarb
Copy link

elvarb commented Feb 19, 2017

Sorry to add to this issue, but by tag cardinality does that include both tag keys and tag values or just one or the other?

@desa
Copy link
Contributor

desa commented Feb 21, 2017

@elvarb usually we mean a single tag key with many tag values as the the cardinality of a tag. As mentioned above this is very much just a rule of thumb and is increasingly not relevant.

At the moment we're working on #7151 which will remove these types of restrictions.

@elvarb
Copy link

elvarb commented Feb 21, 2017

@desa thanks for the info, I have been testing using influxdb to track logs and using tags for the log metadata. Extremely promising and glad to hear that this possible problem will be removed in the future.

@ivanpricewaycom
Copy link

eek. we just ran into this. given that retention policies can't go less than an hour we are eating all available ram (16g) within the hour with (fairly) unique tag sets of source / destination IP/port plus volume counters (cisco netflow logging). aggregating doesn't help coz just the initial data is killing us, let alone our desire to archive aggregated data. we've got a stress-test python script that simulates our load in case it's interesting.

-i

@lrtanner
Copy link

lrtanner commented Jul 6, 2018

Data newb here. This has been a useful issue to read, but can someone explain cardinality in terms of InfluxDB tags?

@ivanpricewaycom
Copy link

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

7 participants