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

Commit 313b3ec

Browse files
authored
Merge pull request #332 from grafana/playbook-for-CortexIngesterReachingTenantsLimit
Improved CortexIngesterReachingSeriesLimit playbook and added CortexIngesterReachingTenantsLimit playbook
2 parents 9c75e48 + f18d782 commit 313b3ec

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

cortex-mixin/docs/playbooks.md

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,63 @@ If nothing obvious from the above, check for increased load:
2626

2727
### CortexIngesterReachingSeriesLimit
2828

29-
First check the writes resources dashboard and scaling dashboard. The usual target is 1.5M active series per ingester and a max of 2.5M.
29+
This alert fires when the `max_series` per ingester instance limit is enabled and the actual number of in-memory series in a ingester is reaching the limit. Once the limit is reached, writes to the ingester will fail (5xx) for new series, while appending samples to existing ones will continue to succeed.
3030

31-
Scaling up the ingesters will help, but it won't resolve the alert immediately, as series are active until the next TSDB Head compaction (every 2h or so). You may also want to temporarily increase the per ingester series limit (this is a runtime reloadable config option) until that next Head compaction occurs.
31+
In case of **emergency**:
32+
- If the actual number of series is very close or already hit the limit, then you can increase the limit via runtime config to gain some time
33+
- Increasing the limit will increase the ingesters memory utilization. Please monitor the ingesters memory utilization via the `Cortex / Writes Resources` dashboard
34+
35+
How the limit is **configured**:
36+
- The limit can be configured either on CLI (`-ingester.instance-limits.max-series`) or in the runtime config:
37+
```
38+
ingester_limits:
39+
max_series: <int>
40+
```
41+
- The mixin configures the limit in the runtime config and can be fine-tuned via:
42+
```
43+
_config+:: {
44+
ingester_instance_limits+:: {
45+
max_series: <int>
46+
}
47+
}
48+
```
49+
- When configured in the runtime config, changes are applied live without requiring an ingester restart
50+
- The configured limit can be queried via `cortex_ingester_instance_limits{limit="max_series"}`
51+
52+
How to **fix**:
53+
1. **Scale up ingesters**<br />
54+
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).
55+
2. **Temporarily increase the limit**<br />
56+
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.
3257

3358
### CortexIngesterReachingTenantsLimit
3459

35-
_TODO: this playbook has not been written yet._
60+
This alert fires when the `max_tenants` per ingester instance limit is enabled and the actual number of tenants in a ingester is reaching the limit. Once the limit is reached, writes to the ingester will fail (5xx) for new tenants, while they will continue to succeed for previously existing ones.
61+
62+
In case of **emergency**:
63+
- If the actual number of tenants is very close or already hit the limit, then you can increase the limit via runtime config to gain some time
64+
- Increasing the limit will increase the ingesters memory utilization. Please monitor the ingesters memory utilization via the `Cortex / Writes Resources` dashboard
65+
66+
How the limit is **configured**:
67+
- The limit can be configured either on CLI (`-ingester.instance-limits.max-tenants`) or in the runtime config:
68+
```
69+
ingester_limits:
70+
max_tenants: <int>
71+
```
72+
- The mixin configures the limit in the runtime config and can be fine-tuned via:
73+
```
74+
_config+:: {
75+
ingester_instance_limits+:: {
76+
max_tenants: <int>
77+
}
78+
}
79+
```
80+
- When configured in the runtime config, changes are applied live without requiring an ingester restart
81+
- The configured limit can be queried via `cortex_ingester_instance_limits{limit="max_tenants"}`
82+
83+
How to **fix**:
84+
1. Ensure shuffle-sharding is enabled in the Cortex cluster
85+
1. Assuming shuffle-sharding is enabled, scaling up ingesters will lower the number of tenants per ingester. However, the effect of this change will be visible only after `-blocks-storage.tsdb.close-idle-tsdb-timeout` period so you may have to temporarily increase the limit
3686

3787
### CortexRequestLatency
3888
First establish if the alert is for read or write latency. The alert should say.

0 commit comments

Comments
 (0)