Modding · Reading list · Discussion: is the modding-books ecosystem being replaced by another stack?

759
MOr/modding-books·posted by slow_query·32 minutes agoTooling

Discussion: is the modding-books ecosystem being replaced by another stack?

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

Order of investigation, by return on effort: 1. Check downstream latency first — usually it is not your problem 2. Then pool hit rate and wait-queue length 3. Only then GC and allocation 4. Suspect the framework last

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

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.

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

242 comments

242 comments

· first 120 loaded
M
Rran_bo·2 hours ago

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

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

415
Ddev_zhou·just now

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

376
Lli_mingOP·2 days ago

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

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

310
RraseOP·2 days ago

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

224
Bbob_chen·2 days agoedited

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

278
Rrase·2 days agoedited

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

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

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

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

1
Aalice_dev·2 days ago

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

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

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

225
Mmike_xu·2 days ago

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

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

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

5
Ddev_zhou·2 days ago

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

13
Wwinter·2 days agoedited

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

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

303
Aalice_dev·2 days agoedited

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

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

28
Hhuang_ke·2 days ago

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

222
NnikicMod·2 days ago

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

206
Mmike_xuOP·2 days ago

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

221
Kkite·2 days agoedited

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

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

31
Kkite·2 days ago

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

44
Nnikic·2 days ago

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

3
Ttang_hao·2 days ago

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

375
Nnikic·yesterdayedited

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

153
Lli_ming·2 days ago

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

142
Zzhou_yi·2 days ago

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

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

21
Ttang_haoOP·2 days ago

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

78
Cchen_dev·2 days ago

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

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

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

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

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

128
Oops_wang·2 days ago

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

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

91
Sslow_query·2 days ago

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

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

232
Kkernel_panic·2 days ago

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

4
Rrase·just now

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

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

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

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

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

312
Wwinter·1 hour ago

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

295
Cchen_dev·2 days ago

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

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

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

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

438
Mmike_xu·28 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.

384
Rrase·2 days ago

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

106
LlinlinOPMod·5 hours 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.

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

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

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

2
Cchen_dev·2 days ago

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

96
Rran_bo·2 days agoedited

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

51
Llinlin·2 days ago

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

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

59
Kkernel_panic·2 hours ago

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

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

455
Cchen_devMod·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.

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

1
Cchen_dev·2 days ago

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

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

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

36
Aalice_dev·2 days ago

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

34
Hhuang_ke·2 days ago

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

26
Mmike_xu·28 minutes ago

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

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

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

20
Nnikic·3 minutes ago

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

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

6
Wwinter·5 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.

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

1
Wwinter·12 minutes ago

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

6
Oops_wang·2 days ago

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

371
Mmike_xu·12 minutes ago

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

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

292
Mmike_xuOP·2 days ago

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

178
KkiteOP·2 days ago

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

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

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

9
Sswoole_leeMod·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
Zzhou_yi·2 days ago

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

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

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

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

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

5
Kkernel_panic·2 hours ago

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

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

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

50
Kkite·2 days agoedited

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

20
Hhuang_ke·2 days agoedited

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

1
Nnikic·just nowedited

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

2
Kkite·2 days ago

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

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

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.

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

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

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

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

18
Ttang_haoMod·1 hour ago

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

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

159
Zzhou_yi·2 days ago

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

15
Zzhu_zongMod·2 days ago

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

27
Zzhou_yi·2 days agoLevel 6

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

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

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

271
Ddev_zhou·2 days ago

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

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

10
Ttang_hao·12 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
Ttang_haoMod·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.

1

This is the post detail page /en/c/modding-books/post/p1. 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 →