Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 0d48edf

Browse files
authored
Merge pull request #360 from grafana/update-CortexIngesterReachingSeriesLimit-playbook
Improve CortexIngesterReachingSeriesLimit playbook
2 parents b1f797a + 7a44fe8 commit 0d48edf

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

cortex-mixin/docs/playbooks.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,29 @@ How to **fix**:
5353
1. **Temporarily increase the limit**<br />
5454
If the actual number of series is very close or already hit the limit, or if you foresee the ingester will hit the limit before dropping the stale series as effect of the scale up, you should also temporarily increase the limit.
5555
1. **Check if shuffle-sharding shard size is correct**<br />
56-
When shuffle-sharding is enabled, we target to 100K series / tenant / ingester. You can run `avg by (user) (cortex_ingester_memory_series_created_total{namespace="<namespace>"} - cortex_ingester_memory_series_removed_total{namespace="<namespace>"}) > 100000` to find out tenants with > 100K series / ingester. You may want to increase the shard size for these tenants.
56+
- When shuffle-sharding is enabled, we target to 100K series / tenant / ingester assuming tenants on average uses 50% of their max series limit.
57+
- Run the following **instant query** to find tenants that may cause an higher pressure on some ingesters:
58+
```
59+
(
60+
sum by(user) (cortex_ingester_memory_series_created_total{namespace="<namespace>"}
61+
-
62+
cortex_ingester_memory_series_removed_total{namespace="<namespace>"})
63+
)
64+
>
65+
(
66+
max by(user) (cortex_overrides{namespace="<namespace>",limit_name="max_global_series_per_user"})
67+
*
68+
scalar(max(cortex_distributor_replication_factor{namespace="<namespace>"}))
69+
*
70+
0.5
71+
)
72+
> 200000
73+
74+
# Decomment the following to show only tenants beloging to a specific ingester's shard.
75+
# and count by(user) (cortex_ingester_active_series{namespace="<namespace>",pod="ingester-<id>"})
76+
```
77+
- Check the current shard size of each tenant in the output and, if they're not already sharded across all ingesters, you may consider to double their shard size
78+
- The in-memory series in the ingesters will be effectively reduced at the TSDB Head compaction happening at least 1h after you increased the shard size for the affected tenants
5779
1. **Scale up ingesters**<br />
5880
Scaling up ingesters will lower the number of series per ingester. However, the effect of this change will take up to 4h, because after the scale up we need to wait until all stale series are dropped from memory as the effect of TSDB head compaction, which could take up to 4h (with the default config, TSDB keeps in-memory series up to 3h old and it gets compacted every 2h).
5981

0 commit comments

Comments
 (0)