Alertmanager · English · Built a visual debugging panel for alertmanager-en over the weekend

1.1K
ALr/alertmanager-en·posted by rase·2 hours agoTranslation

Built a visual debugging panel for alertmanager-en over the weekend

Most alertmanager-en articles stop at "how to use it" and never cover "when not to use it". This is an attempt at the second half.

Worth noting: the official docs do cover this, just in a very inconspicuous spot. I only found it reading the source comments, where the author explains the reasoning — roughly "so that it degrades into predictable behaviour in extreme cases".

One last trap: in container environments remember to adjust the memory-related parameters in step. Otherwise the host limit and the process expectation disagree, and the symptom is intermittent, unreproducible failure.

Ssegmentfault.comExternal link · opens in a new tab
413 comments

413 comments

· first 120 loaded
M
Sswoole_lee·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

501
Kkernel_panic·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

495
Oops_wang·2 days ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

481
Sswoole_lee·12 minutes ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

476
Cchen_dev·28 minutes ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

427
Aalice_dev·2 days agoedited

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

27
Oops_wang·2 days agoedited

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

485
Hhuang_ke·28 minutes ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

406
Hhuang_ke·2 days ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

487
Cchen_dev·2 hours ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

50
Nnikic·2 days ago

I just read the alertmanager-en source — the author actually explains the reasoning in a comment, roughly "so that it degrades into predictable behaviour in extreme cases".

173
Aalice_dev·5 hours agoedited

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

10
Ddev_zhou·2 days agoedited

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

1
Sswoole_lee·3 minutes ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

303
Llinlin·2 days ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

238
Rrase·2 days agoedited

I just read the alertmanager-en source — the author actually explains the reasoning in a comment, roughly "so that it degrades into predictable behaviour in extreme cases".

78
Cchen_dev·just nowLevel 6

I just read the alertmanager-en source — the author actually explains the reasoning in a comment, roughly "so that it degrades into predictable behaviour in extreme cases".

1
Bbob_chen·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

54
Zzhou_yi·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

5
Lli_ming·2 days ago

Worth learning from this debugging approach. We went straight at the logs and took a much longer route.

59
Mmike_xu·2 days ago

I just read the alertmanager-en source — the author actually explains the reasoning in a comment, roughly "so that it degrades into predictable behaviour in extreme cases".

262
Bbob_chen·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

45
Zzhu_zong·2 days ago

This is not a alertmanager-en problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

313
Sswoole_lee·2 days ago

Worth learning from this debugging approach. We went straight at the logs and took a much longer route.

373
Ddev_zhou·12 minutes ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

186
Rrase·2 days agoLevel 6

One counter-example: below alertmanager-en 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

186
Oops_wang·2 days ago

This is not a alertmanager-en problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

101
Kkernel_panic·2 days ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

4
Oops_wang·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

452
Lli_ming·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

428
Rrase·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

445
Oops_wang·2 days agoedited

Thanks for sharing real numbers — far more useful than the articles that only cover concepts.

399
Hhuang_ke·2 days ago

Worth learning from this debugging approach. We went straight at the logs and took a much longer route.

395
Rran_bo·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

411
Ddev_zhou·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

51
Ddev_zhou·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

394
Hhuang_keMod·3 minutes ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

385
Cchen_dev·2 days agoedited

This is not a alertmanager-en problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

113
Ddev_zhou·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

337
Ddev_zhou·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

336
Ttang_hao·2 days agoedited

Thanks for sharing real numbers — far more useful than the articles that only cover concepts.

40
Oops_wang·2 hours ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

285
Rrase·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

262
Hhuang_ke·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

492
Sslow_query·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

237
Lli_ming·2 days ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

155
Hhuang_ke·2 days agoedited

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

208
Rrase·28 minutes ago

One counter-example: below alertmanager-en 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

189
Hhuang_ke·3 minutes ago

I just read the alertmanager-en source — the author actually explains the reasoning in a comment, roughly "so that it degrades into predictable behaviour in extreme cases".

497
Ddev_zhou·5 hours ago

Worth learning from this debugging approach. We went straight at the logs and took a much longer route.

50
Ddev_zhou·3 minutes agoedited

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

69
Ttang_hao·5 hours ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

58
KkiteOP·2 days ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

328
Sslow_query·12 minutes agoLevel 6

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

188
Zzhu_zong·3 minutes ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

386
Zzhu_zong·1 hour agoLevel 6

I just read the alertmanager-en source — the author actually explains the reasoning in a comment, roughly "so that it degrades into predictable behaviour in extreme cases".

199
Oops_wang·5 hours agoLevel 6

This is not a alertmanager-en problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

21
RraseMod·2 days agoLevel 6

Thanks for sharing real numbers — far more useful than the articles that only cover concepts.

1
Wwinter·28 minutes ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

188
Llinlin·yesterdayLevel 6

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

35
Cchen_dev·2 days ago

Thanks for sharing real numbers — far more useful than the articles that only cover concepts.

163
Hhuang_keOP·2 days agoLevel 6

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

333
Wwinter·2 days ago

Thanks for sharing real numbers — far more useful than the articles that only cover concepts.

132
Bbob_chen·2 days agoLevel 6

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

78
Cchen_dev·2 days ago

Sharing our numbers, 8 cores 16GB, same scenario:

| Concurrency | P50 | P99 |
|---|---|---|
| 200 | 12ms | 88ms |
| 500 | 31ms | 340ms |

P99 clearly collapses at 500 concurrency, which lines up with your knee point.

71
Nnikic·28 minutes ago

Thanks for sharing real numbers — far more useful than the articles that only cover concepts.

11
Ddev_zhou·yesterdayLevel 6

This is not a alertmanager-en problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

69
Mmike_xu·2 days ago

Thanks for sharing real numbers — far more useful than the articles that only cover concepts.

16
Nnikic·12 minutes ago

Sharing our numbers, 8 cores 16GB, same scenario:

| Concurrency | P50 | P99 |
|---|---|---|
| 200 | 12ms | 88ms |
| 500 | 31ms | 340ms |

P99 clearly collapses at 500 concurrency, which lines up with your knee point.

91
Bbob_chen·just now

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

3
Rran_bo·2 days ago

Sharing our numbers, 8 cores 16GB, same scenario:

| Concurrency | P50 | P99 |
|---|---|---|
| 200 | 12ms | 88ms |
| 500 | 31ms | 340ms |

P99 clearly collapses at 500 concurrency, which lines up with your knee point.

392
Bbob_chen·2 hours ago

I just read the alertmanager-en source — the author actually explains the reasoning in a comment, roughly "so that it degrades into predictable behaviour in extreme cases".

390
Hhuang_ke·2 days ago

This is not a alertmanager-en problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

242
Ttang_haoOP·12 minutes agoedited

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

23
Mmike_xuMod·28 minutes agoeditedLevel 6

Saved. I am reworking this area this week — this saves a lot of wrong turns.

21
Llinlin·2 days ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

189
Sswoole_lee·2 days ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

33
Llinlin·2 days ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

452
Bbob_chen·2 hours ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

161
LlinlinOP·2 days ago

One counter-example: below alertmanager-en 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

99
Zzhu_zong·28 minutes agoedited

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

141
Sswoole_lee·yesterday

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

138
Lli_ming·2 days ago

Worth learning from this debugging approach. We went straight at the logs and took a much longer route.

123
Bbob_chen·2 days ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

110
Sslow_query·2 days ago

One counter-example: below alertmanager-en 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

96
KkiteMod·2 days ago

Worth learning from this debugging approach. We went straight at the logs and took a much longer route.

93
Kkernel_panic·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

478
Kkite·1 hour ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

93
Hhuang_ke·2 days agoedited

Worth learning from this debugging approach. We went straight at the logs and took a much longer route.

75
Ddev_zhouOP·12 minutes ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

10
Wwinter·2 days ago

One counter-example: below alertmanager-en 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

66
Rran_boOP·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

3
Lli_ming·2 days ago

I just read the alertmanager-en source — the author actually explains the reasoning in a comment, roughly "so that it degrades into predictable behaviour in extreme cases".

57
Ttang_haoMod·yesterday

One counter-example: below alertmanager-en 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

47
Rrase·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

47
Cchen_dev·2 days ago

Sharing our numbers, 8 cores 16GB, same scenario:

| Concurrency | P50 | P99 |
|---|---|---|
| 200 | 12ms | 88ms |
| 500 | 31ms | 340ms |

P99 clearly collapses at 500 concurrency, which lines up with your knee point.

41
Rrase·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

39
Bbob_chen·2 days ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

30
Mmike_xu·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

26
Sswoole_lee·2 days ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

26
Llinlin·5 hours ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

19
Sswoole_lee·2 days ago

Sharing our numbers, 8 cores 16GB, same scenario:

| Concurrency | P50 | P99 |
|---|---|---|
| 200 | 12ms | 88ms |
| 500 | 31ms | 340ms |

P99 clearly collapses at 500 concurrency, which lines up with your knee point.

16
Kkite·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

13
Wwinter·just nowedited

This is not a alertmanager-en problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

11
Lli_ming·2 days ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

9
Zzhu_zong·just now

Sharing our numbers, 8 cores 16GB, same scenario:

| Concurrency | P50 | P99 |
|---|---|---|
| 200 | 12ms | 88ms |
| 500 | 31ms | 340ms |

P99 clearly collapses at 500 concurrency, which lines up with your knee point.

7
Zzhou_yi·yesterday

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

487
Kkernel_panic·2 hours ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

7
Zzhou_yiMod·2 days ago

This is not a alertmanager-en problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

44
Rran_bo·2 days ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

5
Llinlin·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

4
Kkernel_panicMod·2 days ago

Sharing our numbers, 8 cores 16GB, same scenario:

| Concurrency | P50 | P99 |
|---|---|---|
| 200 | 12ms | 88ms |
| 500 | 31ms | 340ms |

P99 clearly collapses at 500 concurrency, which lines up with your knee point.

3
Nnikic·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

3
RraseMod·2 days agoedited

One counter-example: below alertmanager-en 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

1
Rran_bo·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

61
Aalice_dev·12 minutes ago

Thanks for sharing real numbers — far more useful than the articles that only cover concepts.

1
Hhuang_keMod·2 days ago

Sharing our numbers, 8 cores 16GB, same scenario:

| Concurrency | P50 | P99 |
|---|---|---|
| 200 | 12ms | 88ms |
| 500 | 31ms | 340ms |

P99 clearly collapses at 500 concurrency, which lines up with your knee point.

1
Zzhou_yi·2 days agoedited

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

1
Nnikic·2 days ago

Worth learning from this debugging approach. We went straight at the logs and took a much longer route.

187
Rran_bo·2 days ago

One counter-example: below alertmanager-en 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

6

This is the post detail page /en/c/alertmanager-en/post/p7. Posts and comments are generated deterministically from a seeded PRNG, so the same post always renders the same content and the link can be shared, reloaded and indexed. In production this page reads MySQL for the post, Redis for hot-post caching, and fetches the whole comment tree in a single query on the path column.

See the database schema →