Vue · Remote · Ten vue-remote anti-patterns — how many are you guilty of?

1.8K
VUr/vue-remote·posted by tang_hao·32 minutes agoPostmortem

Ten vue-remote anti-patterns — how many are you guilty of?

Most vue-remote 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.

Worth noting: the official docs do cover this, just in a very inconspicuous spot. I only found it reading the source comments, where the author explains the reasoning — roughly "so that it degrades into predictable behaviour in extreme cases".

Ggithub.comExternal link · opens in a new tab
1043 comments

1043 comments

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

513
RraseOP·2 days ago

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

448
Zzhou_yi·2 days ago

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

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

416
Sswoole_lee·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".

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

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

447
Llinlin·12 minutes 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.

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

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

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

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

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

13
Lli_mingOP·1 hour ago

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

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

246
Ddev_zhou·just nowedited

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

233
Kkite·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
NnikicMod·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".

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

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

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

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

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

159
Llinlin·2 days ago

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

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

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

192
Hhuang_ke·yesterday

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.

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

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

139
Sswoole_lee·2 days ago

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

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

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

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

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

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

324
Nnikic·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".

159
Lli_ming·2 days ago

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

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

82
RraseOPMod·28 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.

224
Sslow_query·2 days ago

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

118
Bbob_chenOP·2 days ago

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

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

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

416
Cchen_dev·5 hours ago

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

456
Zzhou_yi·2 days agoLevel 6

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

281
Zzhu_zongOP·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.

9
Bbob_chen·2 days ago

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

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

222
Ddev_zhouOP·12 minutes ago

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

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

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

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

105
Sslow_query·3 minutes ago

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

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

84
Rran_bo·3 minutes ago

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

68
Bbob_chen·28 minutes ago

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

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

516
Rran_bo·3 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".

20
Bbob_chen·2 hours ago

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

154
Rran_bo·28 minutes agoedited

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

123
Kkernel_panic·2 days agoedited

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

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

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

49
Ddev_zhou·2 hours ago

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

88
Kkernel_panic·2 days agoLevel 6

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

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

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

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

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

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

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

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

5
Bbob_chen·1 hour ago

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

65
KkiteOP·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".

2
Rrase·3 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.

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

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

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

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

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

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

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

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

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

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

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

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

90
Wwinter·5 hours ago

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

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

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

176
Aalice_dev·2 hours 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.

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

497
Rrase·2 days ago

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

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

12
Zzhu_zong·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
Kkernel_panic·2 days agoeditedLevel 6

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.

5
Rrase·2 days agoedited

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.

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

2
Ddev_zhou·2 days ago

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

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

6
Lli_ming·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".

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

148
Ttang_hao·2 days ago

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

9
Sswoole_lee·2 hours 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
Oops_wang·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
Kkite·2 hours ago

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

43
Kkite·2 days ago

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

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

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

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

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

94
Rrase·2 days ago

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

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

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

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

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

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

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

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

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

1

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