Edge Computing · Showcase · Six rules for error handling in edge-computing-show that I settled on

1.5K
ECr/edge-computing-show·posted by winter·32 minutes agoTranslation

Six rules for error handling in edge-computing-show that I settled on

Some background first. Our setup is edge-computing-show plus three downstream services, seven figures of daily requests, peaking around nine in the evening.

The first thing was to collapse the variables. We were changing config and upgrading the version at the same time, and afterwards nobody could say which change caused what. We rolled back to moving one variable at a time, re-ran three times, and only then did the curve settle. Tedious, but not skippable.

Image placeholder · object storage in production
POST /api/uploads → CDN origin pull
788 comments

788 comments

· first 120 loaded
M
Cchen_dev·2 days ago

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

514
Zzhu_zong·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.

397
Zzhu_zongOP·3 minutes ago

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

329
Mmike_xu·12 minutes agoedited

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

358
Ddev_zhou·2 days ago

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

60
Rrase·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.

58
Llinlin·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.

24
Cchen_dev·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.

86
Wwinter·2 days agoedited

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

165
Aalice_dev·2 days ago

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

259
Kkernel_panic·2 days ago

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

172
Llinlin·2 days ago

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

4
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.

53
Zzhu_zong·just now

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

153
Kkernel_panic·12 minutes agoedited

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

117
Zzhou_yi·2 days ago

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

94
Kkernel_panic·yesterday

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

22
Kkite·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.

36
Zzhou_yi·2 days agoeditedLevel 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.

1
Kkernel_panic·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.

1
Kkernel_panicOP·yesterday

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.

451
Rran_bo·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.

371
Sswoole_lee·yesterday

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.

356
Hhuang_ke·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.

184
Cchen_devOP·just now

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.

294
KkiteOP·1 hour 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
Wwinter·2 days ago

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

349
Zzhu_zong·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.

273
Mmike_xu·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.

95
Zzhu_zong·yesterday

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

185
Mmike_xuMod·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.

388
Kkernel_panic·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.

37
Rrase·2 days ago

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

9
Aalice_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.

499
Cchen_dev·2 days ago

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

12
Lli_ming·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.

3
Lli_mingOP·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.

498
Sslow_query·2 days ago

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

357
NnikicOP·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
Llinlin·2 hours 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.

80
NnikicOP·2 days agoLevel 6

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

172
Ddev_zhou·2 hours 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.

34
Mmike_xu·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.

20
Sslow_query·2 days agoLevel 6

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

15
Ttang_hao·2 days ago

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

357
Zzhu_zong·2 days agoedited

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.

271
Rran_bo·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.

1
Hhuang_ke·2 days ago

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

303
Rrase·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.

12
Aalice_dev·28 minutes ago

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

114
Ttang_hao·just now

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.

258
Hhuang_ke·2 days ago

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

247
Aalice_dev·2 days ago

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

174
Zzhu_zongOP·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.

185
Kkite·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.

232
Nnikic·just now

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

113
Zzhou_yi·1 hour ago

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

206
Kkite·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.

55
Hhuang_ke·3 minutes ago

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

19
Kkite·2 days ago

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

183
Ddev_zhou·2 days ago

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

162
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.

162
Lli_ming·3 minutes ago

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

154
Sslow_query·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.

468
Lli_ming·2 days ago

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

168
Mmike_xu·2 days ago

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

296
Rrase·2 days agoedited

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.

139
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.

139
Wwinter·2 days ago

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

138
Cchen_devMod·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.

132
Bbob_chen·1 hour 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.

115
Cchen_devOP·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.

48
Mmike_xu·just now

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.

71
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.

289
Lli_mingOP·3 minutes ago

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

10
Zzhu_zong·yesterday

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

63
Llinlin·5 hours ago

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

58
Zzhu_zong·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
Ttang_hao·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.

6
Kkernel_panic·2 days ago

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

52
Mmike_xu·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.

47
Ddev_zhou·2 hours agoedited

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

42
Lli_ming·3 minutes 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.

40
Hhuang_ke·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.

350
Lli_ming·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.

195
Aalice_dev·2 days ago

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

35
Wwinter·2 days agoedited

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.

26
Aalice_dev·2 days ago

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

43
Llinlin·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.

212
Rrase·2 hours ago

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

38
Hhuang_ke·2 days 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.

35
Ttang_hao·2 days ago

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

33
Kkernel_panic·2 days ago

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

80
Ddev_zhouMod·12 minutes ago

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

1
Llinlin·yesterdayedited

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

139
Wwinter·2 days ago

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

28
Sslow_query·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.

28
Ttang_hao·2 days ago

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

28
Aalice_dev·28 minutes ago

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

27
Cchen_dev·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.

25
KkiteOP·just nowedited

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
Zzhu_zong·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.

22
Rrase·2 days agoedited

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.

17
Lli_ming·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.

14
Wwinter·12 minutes ago

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

10
Cchen_dev·2 days ago

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

8
Sslow_query·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.

7
Kkernel_panic·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.

217
Zzhou_yiOPMod·5 hours agoedited

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

1
Lli_ming·3 minutes ago

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

6
Zzhou_yi·just now

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

385
Kkite·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.

345
Zzhu_zong·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.

35
Bbob_chen·2 days ago

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

6
Oops_wang·2 days ago

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

3
Hhuang_ke·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.

1
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.

12
Ddev_zhou·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.

294
Sswoole_lee·2 days ago

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

1
Ttang_hao·12 minutes ago

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

1

This is the post detail page /en/c/edge-computing-show/post/p12. 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 →