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

carbonserver: introduce new max-inflight-requests and no-service-when-index-is-not-ready configs #443

Merged
merged 1 commit into from
Dec 20, 2021

Conversation

bom-d-van
Copy link
Member

@bom-d-van bom-d-van commented Dec 14, 2021

carbonserver.max-inflight-requests:

Maximum inflight requests allowed in go-carbon. Default is 0 which means no limit.
If limit is reached, go-carbon/carbonserver returns 429 (Too Many Requests).
This option would be handy as if there are too many long running requests piling up,
it would slows down data ingestion in persister and slows down index building
(especially during restart).

carbonserver.no-service-when-index-is-not-ready:

Returns 503 (Service Unavailable) when go-carbon is still building the first
index cache (trie/trigram) after restart. With trie or trigram index,
carbonserver falls back to filepath.Glob when index is not ready. And
filepath.Glob is expensive and not scaled enough to support some heavy
queries (manifested as high usage and frequent GC). Thus it is possible that
the read requests is so heavy that it not only slows down index building, it
also hinders persister from flushing down data to disk and causing cache.size
overflow.

By default, it is disabled.

It is recommend to enable this flag together with "file-list-cache" (depends on
the number of metrics, indexing building with "file-list-cache" is usually
much faster than re-scanning the whole file tree after restart).

These two configs could be used to stop carbonserver from starving persister
and indexing goroutines.

…-index-is-not-ready configs

carbonserver.max-inflight-requests:
  Maximum inflight requests allowed in go-carbon. Default is 0 which means no limit.
  If limit is reached, go-carbon/carbonserver returns 429 (Too Many Requests).
  This option would be handy as if there are too many long running requests piling up,
  it would slows down data ingestion in persister and slows down index building
  (especially during restart).

carbonserver.no-service-when-index-is-not-ready:
  Returns 503 (Service Unavailable) when go-carbon is still building the first
  index cache (trie/trigram) after restart. With trie or trigram index,
  carbonserver falls back to filepath.Glob when index is not ready. And
  filepath.Glob is expensive and not scaled enough to support some heavy
  queries (manifested as high usage and frequent GC). Thus it is possible that
  the read requests is so heavy that it not only slows down index building, it
  also hinders persister from flushing down data to disk and causing cache.size
  overflow.

  By default, it is disabled.

  It is recommend to enable this flag together with "file-list-cache" (depends on
  the number of metrics, indexing building with "file-list-cache" is usually
  much faster than re-scanning the whole file tree after restart).

These two configs could be used to stop carbonserver from starving persister
and index building goroutines.
@bom-d-van bom-d-van merged commit e0a132a into master Dec 20, 2021
@bom-d-van bom-d-van deleted the carbonserver/rate-limiting branch December 20, 2021 14:07
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

Successfully merging this pull request may close these issues.

None yet

1 participant