Vue · Advanced · This vue-pro bug hid for three years before anyone reported it

349
VUr/vue-pro·posted by alice_dev·just nowInternals

This vue-pro bug hid for three years before anyone reported it

Short version: vue-pro needs almost no tuning at small and medium scale — the point where it starts to hurt is much further out than most people assume. Full measurements below.

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.

Self-host — full control44%
Managed service — less work28%
Hybrid: core self-hosted17%
Not decided yet11%

593 votes total

120 comments

120 comments

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

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

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

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

407
Llinlin·2 days ago

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

307
Zzhou_yi·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
LlinlinOP·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.

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

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

403
Sslow_query·2 hours ago

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

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

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

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

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

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

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

63
Sswoole_lee·2 days ago

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

304
Oops_wang·2 days ago

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

302
Oops_wangMod·2 days ago

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

271
Kkite·2 days ago

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

50
Zzhu_zongOP·yesterdayedited

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

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

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

156
Llinlin·2 days ago

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

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

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

187
Rrase·2 days ago

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

177
Rran_bo·2 days agoedited

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

171
Oops_wang·just now

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.

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

273
Kkite·28 minutes ago

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

8
NnikicMod·2 days ago

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

19
Nnikic·2 days ago

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

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

188
Hhuang_ke·2 days ago

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

1
Kkernel_panic·2 days ago

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

4
Ddev_zhou·2 days ago

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

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

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

503
KkiteOP·2 hours ago

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

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

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

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

105
Zzhu_zong·just nowedited

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

450
Rran_bo·2 days ago

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

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

120
Mmike_xu·3 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.

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

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

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

176
Lli_ming·2 days ago

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

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

250
Cchen_devOP·2 days agoLevel 6

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

38
Hhuang_ke·5 hours ago

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

2
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
KkiteOP·28 minutes 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.

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

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

359
NnikicOP·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.

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

140
Aalice_devOP·28 minutes 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.

18
Hhuang_ke·yesterday

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.

183
Zzhou_yi·2 days ago

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

506
Cchen_devOP·just now

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

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

109
Wwinter·2 days agoLevel 6

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

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

144
Oops_wang·2 days agoLevel 6

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

13
Sswoole_lee·2 days ago

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

37
Hhuang_ke·2 days ago

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

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

59
Zzhou_yi·just now

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

159
Nnikic·2 days ago

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

466
Llinlin·yesterdayedited

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

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

327
Sswoole_lee·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
Sswoole_leeOP·12 minutes ago

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

119
Lli_ming·28 minutes ago

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

426
Ddev_zhou·12 minutes ago

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

498
Hhuang_ke·2 days agoeditedLevel 6

One counter-example: below vue-pro 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
Zzhou_yi·2 days ago

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

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

50
Rran_boOP·2 days agoLevel 6

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

11
Sslow_query·3 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.

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

414
Oops_wangMod·1 hour ago

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

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

96
Hhuang_keOP·2 days ago

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

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

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

353
Zzhou_yi·1 hour ago

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

5
Llinlin·2 days ago

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

4
Kkernel_panic·3 minutes ago

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

31
Zzhou_yi·12 minutes ago

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

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

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

115
Sslow_query·2 days ago

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

3
Cchen_dev·2 days ago

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

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

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

99
Sswoole_leeOP·2 hours ago

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

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

324
Wwinter·2 days agoedited

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

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

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

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

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

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

31
NnikicMod·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.

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

10
Ttang_hao·3 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.

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

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

63
Sslow_query·yesterday

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

5
Sswoole_lee·28 minutes ago

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

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

1
Hhuang_ke·1 hour ago

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

1
Mmike_xu·just now

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

1
Zzhu_zong·1 hour ago

One counter-example: below vue-pro 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
Bbob_chen·2 days ago

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

1

This is the post detail page /en/c/vue-pro/post/p9. 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 →