diff --git a/docs/sources/setup/upgrade/_index.md b/docs/sources/setup/upgrade/_index.md index 74d8b971319d8..481cf14182d70 100644 --- a/docs/sources/setup/upgrade/_index.md +++ b/docs/sources/setup/upgrade/_index.md @@ -174,6 +174,10 @@ This new metric will provide a more clear signal that there is an issue with ing | `legacy-read-mode` | false | true | Deprecated. It will be removed in the next minor release. | {{% /responsive-table %}} +#### Automatic stream sharding is enabled by default + +Automatic stream sharding helps keep the write load of high volume streams balanced across ingesters and helps to avoid hot-spotting. Check out the [operations page](https://grafana.com/docs/loki/latest/operations/automatic-stream-sharding/) for more information + #### Write dedupe cache is deprecated Write dedupe cache is deprecated because it not required by the newer single store indexes ([TSDB]({{< relref "../../operations/storage/tsdb" >}}) and [boltdb-shipper]({{< relref "../../operations/storage/boltdb-shipper" >}})). If you using a [legacy index type]({{< relref "../../storage#index-storage" >}}), consider migrating to TSDB (recommended). diff --git a/pkg/distributor/shardstreams/config.go b/pkg/distributor/shardstreams/config.go index 90f1e65600a9b..1bf1f89f961c6 100644 --- a/pkg/distributor/shardstreams/config.go +++ b/pkg/distributor/shardstreams/config.go @@ -16,8 +16,8 @@ type Config struct { } func (cfg *Config) RegisterFlagsWithPrefix(prefix string, fs *flag.FlagSet) { - fs.BoolVar(&cfg.Enabled, prefix+".enabled", false, "Automatically shard streams to keep them under the per-stream rate limit") + fs.BoolVar(&cfg.Enabled, prefix+".enabled", true, "Automatically shard streams to keep them under the per-stream rate limit") fs.BoolVar(&cfg.LoggingEnabled, prefix+".logging-enabled", false, "Enable logging when sharding streams") - cfg.DesiredRate.Set("3mb") //nolint:errcheck - fs.Var(&cfg.DesiredRate, prefix+".desired-rate", "threshold used to cut a new shard. Default (3MB) means if a rate is above 3MB, it will be sharded.") + cfg.DesiredRate.Set("1536KB") //nolint:errcheck + fs.Var(&cfg.DesiredRate, prefix+".desired-rate", "threshold used to cut a new shard. Default (1536KB) means if a rate is above 1536KB/s, it will be sharded.") } diff --git a/pkg/ingester/instance_test.go b/pkg/ingester/instance_test.go index ed78943c23c4d..505f8a73a8d75 100644 --- a/pkg/ingester/instance_test.go +++ b/pkg/ingester/instance_test.go @@ -1082,8 +1082,8 @@ func TestStreamShardingUsage(t *testing.T) { tenantShardStreamsCfg := limiter.limits.ShardStreams(customTenant1) t.Run("test default configuration", func(t *testing.T) { - require.Equal(t, false, defaultShardStreamsCfg.Enabled) - require.Equal(t, "3MB", defaultShardStreamsCfg.DesiredRate.String()) + require.Equal(t, true, defaultShardStreamsCfg.Enabled) + require.Equal(t, "1536KB", defaultShardStreamsCfg.DesiredRate.String()) require.Equal(t, false, defaultShardStreamsCfg.LoggingEnabled) })