Vue · Remote · After reading the vue-remote core source I finally understand the trade-offs

2.3K
VUr/vue-remote·posted by tang_hao·just nowDiscussion

After reading the vue-remote core source I finally understand the trade-offs

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

Image placeholder · object storage in production
POST /api/uploads → CDN origin pull
274 comments

274 comments

· first 120 loaded
M
Ddev_zhou·5 hours ago

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

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

1
Kkernel_panic·2 days ago

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

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

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

74
RraseMod·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.

448
Cchen_dev·2 days ago

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

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

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

257
Mmike_xu·2 days ago

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

23
Wwinter·just nowedited

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.

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

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

245
Kkite·5 hours ago

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

227
Rran_bo·2 days ago

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

444
Bbob_chen·2 days ago

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

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

400
KkiteOP·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.

307
Rrase·2 days ago

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

205
Nnikic·2 days ago

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

363
Kkite·just now

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

354
Ddev_zhou·2 days ago

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

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

52
Sslow_query·2 days agoedited

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

2
Lli_ming·2 days ago

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

9
Mmike_xu·2 days agoedited

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

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

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

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

299
Hhuang_ke·2 days ago

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

82
Aalice_dev·2 days agoedited

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

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

249
Cchen_dev·3 minutes ago

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

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

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

333
Ttang_hao·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
Sswoole_lee·2 hours agoedited

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

394
Ttang_haoOP·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.

235
Kkernel_panicOP·3 minutes ago

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

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

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

264
Hhuang_ke·2 days ago

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

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

500
Sswoole_lee·2 days ago

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

316
Wwinter·2 days ago

This is not a vue-remote 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·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.

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

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

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

169
Llinlin·2 days ago

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

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

56
Bbob_chen·2 hours ago

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

309
Sswoole_leeMod·28 minutes ago

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

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

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

156
Kkernel_panic·2 days ago

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

139
Sswoole_leeMod·3 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.

125
Cchen_dev·1 hour ago

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

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

81
Llinlin·2 days ago

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

120
Cchen_dev·2 days ago

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

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

50
Cchen_dev·28 minutes ago

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

91
Rrase·2 days ago

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

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

4
Bbob_chen·2 days ago

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

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

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

72
Aalice_dev·2 days agoLevel 6

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.

82
Cchen_dev·5 hours agoLevel 6

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

4
Mmike_xu·2 days agoedited

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

248
Zzhu_zong·2 days agoLevel 6

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

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.

175
Aalice_dev·yesterday

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

26
Ttang_hao·2 days agoLevel 6

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

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

182
Oops_wang·2 days agoLevel 6

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

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

25
Oops_wang·just now

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

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

169
Hhuang_ke·2 days 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.

8
Rran_bo·2 days ago

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

36
Mmike_xu·2 days agoLevel 6

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

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

49
Wwinter·5 hours ago

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

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

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

289
Kkite·1 hour ago

One counter-example: below vue-remote 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
Bbob_chen·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.

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

25
Oops_wangOP·2 days ago

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

36
Sswoole_lee·5 hours ago

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

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

80
Kkernel_panic·3 minutes ago

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

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

89
Mmike_xu·2 days ago

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

13
Ttang_hao·2 days ago

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

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

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

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

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

42
Ddev_zhou·3 minutes ago

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

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

187
WwinterOP·2 days ago

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

85
Ddev_zhou·2 days ago

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

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

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

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

15
Aalice_dev·2 days ago

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

25
Rrase·2 days ago

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

7
Hhuang_ke·28 minutes agoedited

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

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

2
Zzhou_yi·2 days ago

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

2
Rrase·2 days ago

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

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

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

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

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

1

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