Vue Community · Vue under load on an 8-core 16GB box — full benchmark scripts included

1.6K
Vr/vue·posted by zhou_yi·6 hours agoAnnouncement

Vue under load on an 8-core 16GB box — full benchmark scripts included

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.

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.

What genuinely surprised me was the tail. The average looked great while P99 jumped by an order of magnitude past some threshold. The cause was not Vue itself but our upstream connection reuse — the load test traffic was too clean and hid the long-tail requests.

Bblog.cloudflare.comExternal link · opens in a new tab
285 comments

285 comments

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

498
Zzhu_zong·28 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".

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

506
Lli_ming·28 minutes agoedited

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

480
Wwinter·1 hour 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".

1
Aalice_dev·2 days ago

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

435
Aalice_dev·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".

209
Cchen_dev·yesterday

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

67
Rran_bo·2 days agoLevel 6

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

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

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

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

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

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

264
Kkite·2 days ago

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

141
Kkite·2 days agoLevel 6

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.

396
Sswoole_lee·28 minutes agoeditedLevel 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.

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

171
Ddev_zhou·just now

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.

285
Lli_ming·2 days ago

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

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

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

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

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

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

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

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

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

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

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

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

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

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

301
RraseOP·2 days ago

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

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.

326
LlinlinOP·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.

295
Llinlin·2 days ago

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

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

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

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

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

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

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

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

289
Sswoole_lee·2 days agoedited

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

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

275
Llinlin·2 days agoedited

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

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

206
Llinlin·2 days ago

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

266
Rran_bo·12 minutes ago

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

250
Hhuang_keOP·2 hours ago

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

33
Oops_wang·2 days agoedited

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

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

2
Aalice_dev·12 minutes ago

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

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

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

120
Aalice_devOP·2 days ago

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

55
Rran_bo·just nowLevel 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.

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

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

276
Zzhou_yi·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".

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

250
Rran_boMod·28 minutes agoedited

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.

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

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

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

8
Zzhu_zong·2 days ago

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

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

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

201
Wwinter·12 minutes ago

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

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

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

176
Ttang_haoMod·2 days ago

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

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

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

100
Sslow_query·3 minutes agoedited

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.

149
Sswoole_leeMod·2 days ago

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

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

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

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

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

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

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

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

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

245
Zzhu_zong·28 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.

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

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

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

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

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

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

327
Sswoole_lee·2 hours ago

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

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

149
Cchen_dev·2 days agoedited

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

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

374
Zzhu_zongOP·3 minutes ago

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

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

36
RraseMod·2 days agoedited

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

331
Aalice_dev·2 days agoedited

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.

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

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

460
Ddev_zhou·2 days ago

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

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

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

119
Hhuang_keOP·2 days ago

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

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

485
Llinlin·yesterday

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

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

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

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

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

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

26
Lli_ming·just now

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

25
Rran_bo·2 days ago

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

11
Zzhu_zong·12 minutes ago

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

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

5
Kkite·2 days ago

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

19
Llinlin·2 hours ago

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

4

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