Edge Computing · Resources · Choosing edge-computing-resources: I turned 5 options into a side-by-side comparison

179
ECr/edge-computing-resources·posted by ops_wang·2 hours agoReview

Choosing edge-computing-resources: I turned 5 options into a side-by-side comparison

It took me two weeks of on-and-off digging and plenty of wrong turns. Writing the process down as it happened so the next person spends less time.

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.

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.

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

We also fixed monitoring along the way: replaced average-based alerts with percentiles and split them per endpoint. False alerts dropped by about seventy percent and the on-call rotation visibly cheered up.

94 comments

94 comments

M
Wwinter·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.

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

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

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

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

482
Kkernel_panic·2 days ago

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

107
Zzhu_zong·2 days ago

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

109
Kkernel_panic·12 minutes agoedited

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

433
Zzhou_yi·2 days ago

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

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

367
Sswoole_lee·12 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.

343
Llinlin·28 minutes 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.

326
Rrase·2 days ago

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

271
Oops_wang·3 minutes ago

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

215
Bbob_chen·2 days agoedited

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

166
Bbob_chen·2 days ago

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

147
Sswoole_lee·2 days agoedited

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

145
Sswoole_leeMod·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.

131
Aalice_dev·2 days ago

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

236
Oops_wang·1 hour ago

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

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

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

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

111
Nnikic·3 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.

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

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

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

108
Rran_bo·2 days ago

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

408
Aalice_dev·2 days ago

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

25
Kkernel_panic·2 days ago

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

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

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

107
Ttang_hao·28 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.

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

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

431
Mmike_xuMod·2 days ago

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

104
Wwinter·2 days ago

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

80
Rran_bo·1 hour 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.

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

72
Zzhou_yi·2 days ago

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

9
Wwinter·2 days ago

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

71
Ddev_zhou·2 days agoedited

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

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

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

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

27
Mmike_xu·2 days ago

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

19
Llinlin·2 days ago

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

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

54
Kkernel_panic·just now

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

13
Kkite·5 hours ago

One counter-example: below edge-computing-resources 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·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.

11
Hhuang_ke·12 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.

73
Cchen_devOP·2 days agoedited

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

519
Zzhou_yi·2 days ago

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

38
Mmike_xu·2 days ago

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

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

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

476
Ddev_zhouOP·2 days ago

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

263
Rran_boOP·2 days ago

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

229
Kkernel_panic·1 hour agoedited

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

226
Zzhou_yi·2 days agoLevel 6

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.

123
Nnikic·2 days ago

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

1
Kkernel_panicOP·1 hour ago

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

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

181
Lli_ming·2 hours ago

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

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

4
Zzhou_yi·28 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.

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

235
Kkite·2 hours ago

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

160
RraseOP·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.

38
Zzhou_yi·5 hours ago

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

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

331
Ddev_zhou·2 days agoedited

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

272
Ttang_hao·2 days ago

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

161
Rrase·just nowedited

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.

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

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

102
KkiteMod·2 days agoLevel 6

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

25
Zzhou_yi·2 days ago

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

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

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

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

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

49
Lli_ming·2 days ago

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

32
Rran_bo·2 days 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.

247
Mmike_xu·2 days agoLevel 6

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

80
Hhuang_ke·1 hour 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.

4
Sswoole_lee·yesterdayLevel 6

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

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

13
Oops_wang·2 hours ago

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

74
Nnikic·2 days ago

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

1
Kkernel_panic·2 hours agoedited

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

1
Zzhu_zong·2 days ago

This is not a edge-computing-resources 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-resources/post/p8. 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 →