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

Unclear format of value desired_rate #15546

Open
yongzhang opened this issue Dec 25, 2024 · 2 comments
Open

Unclear format of value desired_rate #15546

yongzhang opened this issue Dec 25, 2024 · 2 comments

Comments

@yongzhang
Copy link

yongzhang commented Dec 25, 2024

Hi, team

When we're trying to tweak desired_rate in shard_streams, we're confused about the correct format.

From this doc, desired_rate is <int>, but default value is 1536KB which is string?

# Define streams sharding behavior.
shard_streams:
  # Automatically shard streams to keep them under the per-stream rate limit.
  # Sharding is dictated by the desired rate.
  # CLI flag: -shard-streams.enabled
  [enabled: <boolean> | default = true]

  # Whether to log sharding streams behavior or not. Not recommended for
  # production environments.
  # CLI flag: -shard-streams.logging-enabled
  [logging_enabled: <boolean> | default = false]

  # Threshold used to cut a new shard. Default (1536KB) means if a rate is above
  # 1536KB/s, it will be sharded into two streams.
  # CLI flag: -shard-streams.desired-rate
  [desired_rate: <int> | default = 1536KB]

But from this guide, is it still int?

limits_config:
  shard_streams:
    enabled: true
    desired_rate: 2097152 #2MiB

I can see 1536KB by reading loki starting logs:

  shard_streams:
    enabled: true
    logging_enabled: false
    desired_rate: 1536KB

So I'm not quite sure which is the correct one, please help, thanks.

@duj4
Copy link

duj4 commented Dec 30, 2024

I am filling it with 3072KB and which is showing as 3MB in the config api.

@yongzhang
Copy link
Author

It looks like the value will be unmarshalled into bytes by reading the code.

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

2 participants