Vue · Advanced · I upgraded our production vue-pro and hit these 11 landmines

1.8K
VUr/vue-pro·posted by tang_hao·32 minutes agoReviewPinned

I upgraded our production vue-pro and hit these 11 landmines

Most vue-pro articles stop at "how to use it" and never cover "when not to use it". This is an attempt at the second half.

// Minimal reproduction: you must use a real long-tail distribution here.
// Uniform load-test traffic will never trigger this.
func (s *Server) handle(ctx context.Context) error {
    conn, err := s.pool.Acquire(ctx)
    if err != nil {
        return fmt.Errorf("acquire: %w", err)
    }
    defer conn.Release()

    return s.do(ctx, conn)
}

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.

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.

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.

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-pro itself but our upstream connection reuse — the load test traffic was too clean and hid the long-tail requests.

1022 comments

1022 comments

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

459
Rrase·2 days ago

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

433
Aalice_dev·2 days agoedited

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

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

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

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

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

396
Cchen_dev·3 minutes ago

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

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

58
Sslow_query·2 days ago

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

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

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

320
Hhuang_keOP·2 days ago

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

37
Kkernel_panic·2 days ago

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

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

6
Rrase·2 days ago

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

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

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

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

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

306
Sslow_query·2 days ago

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

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

303
Llinlin·2 days ago

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

299
Sslow_query·yesterday

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

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

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

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

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

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

260
Llinlin·just now

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

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

55
Zzhou_yi·5 hours ago

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

79
Kkernel_panic·2 days ago

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

495
Rran_bo·2 days agoedited

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

225
Zzhu_zong·2 days agoedited

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

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

169
Llinlin·3 minutes agoedited

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

168
Mmike_xuOP·2 days ago

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

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

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

57
Mmike_xu·2 days ago

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

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

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

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

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

3
Sslow_query·2 days ago

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

213
Zzhu_zong·3 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.

104
Sswoole_leeOP·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
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.

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

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

443
Wwinter·just now

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.

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

19
Wwinter·yesterday

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.

446
Zzhu_zong·2 days ago

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

148
Zzhou_yi·just now

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.

466
Sswoole_leeOP·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.

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

24
Bbob_chen·2 days agoLevel 6

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

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

238
Zzhou_yi·2 days ago

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

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

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

34
Sslow_query·2 days ago

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

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

1
Rrase·2 days ago

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

454
Lli_ming·2 days ago

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

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

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

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

183
Llinlin·just now

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

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

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

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

220
Wwinter·2 days ago

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

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

81
Zzhu_zong·2 days agoLevel 6

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

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

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

89
Sswoole_lee·2 days agoLevel 6

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

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

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

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

419
Ttang_hao·2 days ago

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

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

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

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

32
Nnikic·2 days ago

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

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

75
Ddev_zhou·28 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.

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

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

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

57
Llinlin·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".

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

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

33
Cchen_devOP·2 days ago

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

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

10
Kkernel_panic·2 days agoedited

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

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

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

11
Rran_boOP·2 days agoedited

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

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

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

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

2
Bbob_chen·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".

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

58
Zzhou_yi·2 days ago

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

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

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

115
Kkite·5 hours agoLevel 6

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

85
Bbob_chen·2 days ago

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

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

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

3
Oops_wang·2 days ago

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

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

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

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

1
Rrase·2 days agoedited

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

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