High Concurrency · Code review · Discussion: is the high-concurrency-review ecosystem being replaced by another stack?

1.3K
HCr/high-concurrency-review·posted by swoole_lee·yesterdayReview

Discussion: is the high-concurrency-review ecosystem being replaced by another stack?

Some background first. Our setup is high-concurrency-review 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.

On trade-offs, my view is this: if nobody on the team owns this area long-term, do not introduce a second mechanism. With two coexistence you first have to work out which one is even in play when things break, and that costs far more than the performance you saved.

Nnews.ycombinator.comExternal link · opens in a new tab
550 comments

550 comments

· first 120 loaded
M
Aalice_devOP·2 days ago

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

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

403
Kkernel_panic·yesterday

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

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

182
Ddev_zhou·2 days ago

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

390
Mmike_xuOP·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.

317
Rrase·3 minutes agoedited

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

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

238
Ddev_zhou·28 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.

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

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

345
Oops_wang·2 days ago

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

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

311
Zzhu_zongMod·2 days agoedited

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

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

302
Kkite·2 days ago

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

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

14
Oops_wangOP·2 days agoedited

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

363
Sswoole_lee·2 hours ago

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

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

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

293
Llinlin·3 minutes ago

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

288
Hhuang_keOP·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.

117
Oops_wangOP·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.

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

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

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

106
Bbob_chen·3 minutes ago

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

6
Sslow_query·1 hour agoedited

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

281
Oops_wangMod·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.

231
Rran_bo·2 days ago

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

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

111
Zzhou_yi·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.

92
Bbob_chenMod·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.

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

137
Ddev_zhou·2 days ago

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

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

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

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

189
Bbob_chen·2 days ago

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

49
Llinlin·2 days ago

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

148
Wwinter·2 days ago

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

44
Hhuang_ke·2 days ago

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

9
Ddev_zhou·12 minutes ago

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

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

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

8
Kkernel_panic·yesterdayedited

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

177
Ttang_hao·2 days agoedited

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

150
Rran_bo·2 days ago

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

68
Lli_ming·yesterday

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

257
Kkernel_panic·2 days ago

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

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

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

182
Kkite·2 days ago

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

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

389
Oops_wangOP·2 days ago

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

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

19
Llinlin·2 days agoedited

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

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

145
Kkite·5 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.

288
NnikicOP·just now

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

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

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

281
Cchen_dev·3 minutes ago

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

104
Rran_bo·5 hours ago

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

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

4
Sswoole_lee·2 days ago

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

231
Mmike_xu·2 days agoedited

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

160
Mmike_xu·2 days ago

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

207
Lli_mingOP·1 hour ago

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

38
Aalice_dev·2 days ago

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

88
Bbob_chen·yesterday

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.

75
Bbob_chen·3 minutes ago

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

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

250
Rran_boMod·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.

483
Zzhou_yi·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.

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

13
Sslow_query·5 hours ago

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

267
Nnikic·2 days ago

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

276
Rran_bo·2 days ago

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

280
Zzhu_zong·yesterday

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.

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

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

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

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

385
Kkite·2 days ago

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

375
Kkite·2 days ago

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

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

330
Sslow_query·28 minutes agoLevel 6

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

206
Llinlin·1 hour 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.

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

316
Oops_wang·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
Oops_wang·2 days ago

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

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

1
Oops_wang·2 days ago

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

52
Sswoole_lee·1 hour agoedited

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

47
Oops_wang·2 days ago

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

62
Oops_wang·2 hours 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.

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

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

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

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

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

19
Sswoole_lee·2 days ago

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

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

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

10
Sslow_query·28 minutes ago

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

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

2
Bbob_chen·2 days ago

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

431
Zzhou_yi·2 days agoedited

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

351
Zzhu_zong·2 days ago

One counter-example: below high-concurrency-review 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
NnikicOP·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.

298
Llinlin·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
Kkernel_panicMod·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.

1
Zzhu_zong·2 days ago

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

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

7
Zzhu_zong·2 days ago

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

1
Nnikic·2 days ago

One counter-example: below high-concurrency-review 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

This is the post detail page /en/c/high-concurrency-review/post/p13. 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 →