-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Detecting hidden indices takes nontrivial time #77974
Comments
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @DaveCTurner, is there a way to share an expanded image (or the profile itself) for the last section of the flame graph, just what's under Setting.get? I'm curious if we can simply improve the performance of Setting.get? |
Sure, here it is, although beware that there's only 27 samples in this method so there will be some quantisation error. Some of that is computing the keyset for the index settings (happens once per instance, slightly puzzled why we didn't already compute it in |
We look up the value for `index.hidden` for every index every time we build a new `Metadata`, which involves map lookups and string parsing and so on and takes nontrivial time. This commit moves the value to a field so the lookups are only needed if the index metadata changes. Closes elastic#77974
We look up the value for `index.hidden` for every index every time we build a new `Metadata`, which involves map lookups and string parsing and so on and takes nontrivial time. This commit moves the value to a field so the lookups are only needed if the index metadata changes. Closes #77974
We look up the value for `index.hidden` for every index every time we build a new `Metadata`, which involves map lookups and string parsing and so on and takes nontrivial time. This commit moves the value to a field so the lookups are only needed if the index metadata changes. Closes #77974
Metadata$Builder#build
is called on every node in every cluster state update that changes the cluster metadata. In a busy cluster with many shards, this means it's on a fairly hot path. Profiling cluster state updates in such a cluster indicates that this method spends about 23% of its time callingSetting#get
:The only such call is this one:
elasticsearch/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java
Line 1436 in 411d7e7
Frequently-accessed settings in
IndexMetadata
are generally made into fields to avoid having to do the lookup work on each access. We can make a substantial time saving in this method by moving theindex.hidden
setting to a field.The text was updated successfully, but these errors were encountered: