Verilog · Beginners · The verilog-newbie execution flow in one diagram (with sequence chart)

2.2K
VEr/verilog-newbie·posted by dev_zhou·just nowJobs

The verilog-newbie execution flow in one diagram (with sequence chart)

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.

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.

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

954 comments

· first 120 loaded
M
Ttang_hao·just now

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

475
Kkernel_panic·28 minutes ago

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

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

439
Ttang_hao·2 days ago

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

139
Llinlin·2 days ago

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

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

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

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

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

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

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

515
Sswoole_lee·2 days ago

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

294
Ddev_zhou·1 hour ago

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

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

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

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

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

505
Hhuang_ke·2 days agoedited

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

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

3
Kkite·2 days agoLevel 6

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

35
Aalice_dev·2 days agoLevel 6

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

1
Aalice_dev·2 days ago

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

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

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

139
Hhuang_ke·2 days ago

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

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

175
Wwinter·2 days ago

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

24
KkiteMod·just now

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

82
Cchen_dev·yesterday

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

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

86
Aalice_devOP·5 hours agoedited

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

2
Cchen_devMod·1 hour 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.

11
Ttang_hao·12 minutes ago

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

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

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

58
Lli_mingOP·yesterday

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.

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

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

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

175
Aalice_dev·12 minutes ago

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

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

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

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

133
WwinterMod·2 days ago

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

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

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

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

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

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

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

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

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

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

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

171
Ddev_zhouMod·2 days ago

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

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

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

67
Hhuang_ke·28 minutes agoedited

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

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

114
Sslow_query·just nowedited

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.

9
Mmike_xu·2 days ago

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

423
Rrase·2 days ago

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

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

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

95
Rran_bo·5 hours ago

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

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

86
Ddev_zhou·3 minutes ago

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

84
Wwinter·2 days ago

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

102
Bbob_chen·5 hours ago

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

223
Oops_wang·2 days ago

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

498
Nnikic·2 days ago

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

391
Ddev_zhouMod·2 days ago

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

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

99
Sslow_query·2 days ago

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

19
Ddev_zhou·2 days agoedited

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

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

296
Cchen_dev·2 days ago

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

177
Oops_wang·2 days agoLevel 6

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

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

17
Llinlin·2 hours ago

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

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

113
Llinlin·3 minutes ago

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

62
Lli_ming·3 minutes ago

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

169
Ddev_zhouMod·2 days agoedited

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

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

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

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

141
Bbob_chen·12 minutes ago

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

21
Cchen_dev·just now

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

7
Hhuang_ke·2 days ago

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

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

2
Hhuang_ke·2 days ago

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

8
Rrase·2 days ago

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

44
Hhuang_ke·2 days agoedited

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

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

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

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

60
Mmike_xu·2 days ago

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

201
Llinlin·1 hour ago

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

59
Sswoole_lee·yesterday

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

45
Oops_wangMod·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.

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

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

73
Kkernel_panic·2 days ago

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

349
Rrase·2 days ago

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

50
Wwinter·2 days ago

One counter-example: below verilog-newbie 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
Sslow_query·2 days ago

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

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

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

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

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

4
Hhuang_ke·2 days ago

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

468
Ttang_hao·2 days ago

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

14
Kkernel_panic·3 minutes ago

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

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

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

10
LlinlinMod·5 hours ago

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

64
Oops_wangMod·2 days ago

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

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

1
Llinlin·2 days ago

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

94

This is the post detail page /en/c/verilog-newbie/post/p3. 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 →