Edge Computing · Showcase · edge-computing-show logging: what separates "readable" from "usable"

1.1K
ECr/edge-computing-show·posted by tang_hao·2 hours agoTranslation

edge-computing-show logging: what separates "readable" from "usable"

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

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.

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

175 comments

· first 120 loaded
M
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.

474
Cchen_dev·2 days ago

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

200
Oops_wang·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.

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

401
Bbob_chen·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.

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

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

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.

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

380
Llinlin·3 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.

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

38
Cchen_dev·2 days ago

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

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

31
Zzhu_zong·2 hours ago

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

332
Ttang_hao·5 hours agoedited

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

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

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

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

281
Wwinter·2 hours 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.

273
Hhuang_ke·2 days ago

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

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

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

221
Rrase·5 hours agoedited

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

206
Zzhu_zongOPMod·5 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.

152
Oops_wang·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.

194
Cchen_dev·2 days ago

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

15
Zzhou_yi·2 days ago

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

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

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

129
Ttang_hao·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.

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

183
Nnikic·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.

181
Ttang_hao·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".

173
Kkite·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".

166
Zzhu_zong·2 days agoedited

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

53
Kkernel_panic·2 hours 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.

165
Kkernel_panicOP·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.

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

140
Ddev_zhouMod·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.

132
Kkernel_panicOP·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.

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

103
WwinterOP·12 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.

38
Oops_wang·5 hours 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.

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

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

60
Zzhou_yi·1 hour 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.

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

504
Lli_ming·just nowLevel 6

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

172
Rran_bo·2 days ago

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

153
Ttang_hao·2 days agoLevel 6

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

347
Lli_ming·2 days agoLevel 6

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

1
Wwinter·just now

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.

155
Ttang_hao·12 minutes 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.

383
Bbob_chen·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
Kkernel_panic·2 days ago

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

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

202
Sswoole_lee·2 days agoLevel 6

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.

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

55
Zzhu_zong·12 minutes agoLevel 6

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.

349
Ddev_zhou·2 days ago

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

17
Zzhu_zong·2 days ago

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

1
Bbob_chen·just now

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

280
Sslow_query·12 minutes ago

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

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

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

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

83
Bbob_chen·12 minutes 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.

72
Hhuang_ke·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".

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

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

13
Kkernel_panicMod·2 days agoedited

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

383
Oops_wang·2 days agoedited

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.

128
Bbob_chen·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.

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

14
Zzhou_yi·1 hour ago

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

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

380
Nnikic·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.

379
Hhuang_keOP·2 days agoeditedLevel 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.

151
Aalice_dev·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.

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

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

131
Sslow_query·2 days agoLevel 6

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.

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

3
Nnikic·5 hours 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
Cchen_devOP·2 days ago

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

348
Oops_wang·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.

123
Kkernel_panicOP·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.

378
Nnikic·2 days agoLevel 6

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
Rrase·2 days agoedited

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

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

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

77
Kkernel_panic·2 days ago

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

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

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

52
Hhuang_ke·yesterday

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

50
Hhuang_ke·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
Bbob_chen·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.

70
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".

33
Lli_ming·yesterday

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

30
Oops_wang·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.

30
Ttang_hao·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".

25
Rran_bo·28 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.

90
Zzhou_yi·2 days ago

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

33
Rran_bo·2 days ago

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

56
Zzhou_yi·2 days ago

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

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

9
Kkernel_panic·28 minutes ago

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

8
Kkernel_panic·5 hours 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.

6
Aalice_dev·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.

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

26
Sswoole_lee·2 days ago

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

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

19
Aalice_dev·2 days ago

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

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

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

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

3
Zzhu_zong·2 days ago

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

125
Aalice_dev·1 hour ago

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

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

1
Kkite·28 minutes agoedited

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

1

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