Monorepo Frontend · Q&A · This monorepo-frontend-qa bug hid for three years before anyone reported it

1.8K
MFr/monorepo-frontend-qa·posted by zhou_yi·1 hour agoToolingLocked

This monorepo-frontend-qa bug hid for three years before anyone reported it

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

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.

Documentation first44%
Source code first28%
Just ask someone17%
Run a demo and learn by error11%

3128 votes total

196 comments

196 comments

· first 120 loaded
M
Ddev_zhou·2 days ago

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

519
Rrase·1 hour 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.

497
Kkite·2 days ago

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

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

432
Sslow_query·just now

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.

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

285
Oops_wang·2 days agoedited

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

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

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

3
Zzhu_zong·2 days ago

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

59
Hhuang_keOP·2 days ago

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

14
Mmike_xu·2 days ago

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

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

362
Ddev_zhou·28 minutes ago

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

398
Nnikic·2 hours ago

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

27
Llinlin·2 days ago

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

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

328
Rran_bo·2 days ago

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

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

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

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

297
Rrase·2 hours ago

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

294
Cchen_dev·2 days ago

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

266
Sslow_query·2 days ago

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

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

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

94
Rrase·2 days ago

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

258
Llinlin·2 days ago

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

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

254
Ttang_hao·5 hours ago

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

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

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

259
Hhuang_ke·2 days ago

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

165
Ttang_hao·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
RraseOP·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.

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

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

418
Cchen_dev·2 days ago

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

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

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

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

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

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

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

62
Mmike_xu·2 days ago

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

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

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

204
Kkite·2 days ago

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

196
Sswoole_lee·2 days ago

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

192
Sswoole_lee·2 days ago

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

5
Rran_bo·3 minutes ago

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

165
Lli_ming·2 days ago

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

25
Mmike_xu·12 minutes 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.

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

259
Kkite·2 days ago

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

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

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

276
Cchen_dev·3 minutes agoedited

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

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

126
Oops_wang·3 minutes ago

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

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

512
Zzhu_zong·2 days ago

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

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

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

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

414
Kkernel_panic·2 hours ago

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

56
Hhuang_keOP·12 minutes ago

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

89
Kkite·12 minutes ago

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

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

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

25
Ddev_zhou·2 days ago

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

510
Rran_bo·12 minutes agoedited

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

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

1
Lli_ming·12 minutes agoedited

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

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

18
Zzhu_zong·2 days agoLevel 6

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

299
Cchen_devOP·1 hour 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.

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

40
Kkite·5 hours ago

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

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

102
Llinlin·2 days ago

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

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

85
Rrase·2 days ago

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

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

448
Zzhu_zong·2 days ago

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

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

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

358
Bbob_chenOP·2 days ago

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

21
Sswoole_lee·3 minutes ago

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

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

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

10
LlinlinOP·2 days agoedited

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

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

139
Zzhu_zong·yesterdayedited

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.

42
Wwinter·28 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.

39
LlinlinOP·2 days agoedited

One counter-example: below monorepo-frontend-qa 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
RraseMod·2 days agoedited

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

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

32
Oops_wang·2 days ago

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

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

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

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

1
Rran_bo·12 minutes agoedited

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

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

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

11
Zzhu_zong·2 hours ago

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

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

5
Ddev_zhou·2 days agoedited

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

4
Wwinter·2 days ago

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

2
Rrase·2 days ago

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

1
Cchen_dev·2 days ago

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

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

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

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

1
Ttang_hao·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
Bbob_chen·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_panic·28 minutes ago

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

48
Sswoole_lee·2 days ago

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/monorepo-frontend-qa/post/p6. 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 →