Vue Community · I upgraded our production Vue and hit these 11 landmines

1.9K
Vr/vue·posted by ran_bo·3 hours agoPostmortem

I upgraded our production Vue and hit these 11 landmines

Short version: Vue 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.

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.

Keep it and wait for an official fix44%
Switch to a third-party option now28%
Fork and maintain it ourselves17%
Write an adapter layer and wait11%

3308 votes total

576 comments

576 comments

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

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

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

436
Zzhu_zong·yesterday

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

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

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

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

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

438
Lli_mingOP·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.

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

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

261
Lli_ming·2 days ago

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

198
Bbob_chen·2 days ago

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

490
Sslow_query·2 days ago

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

53
Sswoole_lee·2 days agoLevel 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.

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

75
Zzhu_zong·2 days ago

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

1
Nnikic·2 days agoLevel 6

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

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

49
Zzhou_yi·2 days agoedited

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

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

316
Hhuang_ke·2 days ago

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

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

385
Zzhu_zong·2 days ago

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

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

166
Ttang_hao·yesterday

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

311
Rrase·yesterday

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.

53
Ddev_zhou·2 days ago

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

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

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

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

269
Kkernel_panic·2 days ago

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

257
Bbob_chen·2 days ago

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

109
Hhuang_ke·2 days ago

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

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

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

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

8
Llinlin·12 minutes ago

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

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

14
Aalice_dev·1 hour 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.

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

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

195
Oops_wangMod·2 days agoLevel 6

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

47
Ddev_zhou·yesterday

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.

35
Bbob_chen·2 days agoLevel 6

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

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

172
Kkite·5 hours ago

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

155
Wwinter·2 days ago

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

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

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

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

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

43
Rrase·2 days ago

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

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

401
LlinlinOP·2 days ago

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

278
Aalice_dev·5 hours ago

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

24
Llinlin·2 days ago

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

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

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

297
Kkite·1 hour 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
Llinlin·2 days ago

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

165
Ttang_hao·2 days ago

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

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

498
Zzhu_zong·2 days ago

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

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

351
Hhuang_ke·2 days ago

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

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

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

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

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

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

21
Zzhou_yi·2 days ago

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

27
Hhuang_ke·yesterday

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

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

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

4
Nnikic·28 minutes ago

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

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

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

108
Lli_ming·2 days ago

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

106
Ttang_hao·3 minutes ago

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

94
Mmike_xu·2 days ago

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

486
Hhuang_ke·2 days ago

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

6
Zzhu_zong·2 days agoedited

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

35
Sslow_query·5 hours ago

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

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

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

78
Zzhu_zong·2 days ago

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

312
Sslow_query·2 days ago

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

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

18
Sslow_query·2 days ago

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

92
Nnikic·2 days agoedited

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

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

23
Hhuang_keOP·2 days ago

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

18
Lli_mingOP·2 days ago

One counter-example: below Vue 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
Sslow_queryOP·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.

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

2
Sswoole_lee·1 hour agoedited

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

41
Oops_wang·yesterday

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

90
Aalice_dev·just now

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

66
Llinlin·2 days ago

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

37
Ttang_hao·3 minutes ago

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

30
Aalice_dev·2 days agoedited

One counter-example: below Vue 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
Ddev_zhou·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.

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

21
Sswoole_lee·2 days ago

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

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

19
Zzhou_yi·2 days agoedited

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

1
Cchen_devMod·2 days ago

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

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

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

217
Hhuang_ke·2 days ago

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

3
Rrase·28 minutes ago

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

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

49
Mmike_xu·5 hours ago

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

1
Ttang_hao·28 minutes ago

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

1
Oops_wang·2 days agoedited

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

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

148
Lli_mingMod·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.

1

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