Editor · Reading list · Newbie question: how should a editor-books config file be organised?

348
EDr/editor-books·posted by huang_ke·3 days agoReview

Newbie question: how should a editor-books config file be organised?

Some background first. Our setup is editor-books plus three downstream services, seven figures of daily requests, peaking around nine in the evening.

We also fixed monitoring along the way: replaced average-based alerts with percentiles and split them per endpoint. False alerts dropped by about seventy percent and the on-call rotation visibly cheered up.

Performance44%
Maintainability28%
Ecosystem and community17%
Hiring difficulty11%

592 votes total

153 comments

153 comments

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

516
Sswoole_lee·2 days ago

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

77
Aalice_dev·2 days ago

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

503
Rran_bo·12 minutes ago

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

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

498
Lli_ming·2 days ago

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

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

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

367
KkiteMod·just now

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

363
Ttang_hao·2 days ago

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

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

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

266
Kkite·yesterday

One counter-example: below editor-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.

483
Aalice_dev·2 days agoedited

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

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

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

221
KkiteOP·12 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.

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

73
Zzhou_yiMod·2 days ago

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

151
Nnikic·2 days ago

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

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

119
Zzhou_yiOP·2 days agoLevel 6

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

259
Rrase·2 days ago

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

40
Nnikic·28 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.

100
Mmike_xu·2 days ago

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

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

20
Ddev_zhou·2 days ago

One counter-example: below editor-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.

11
Wwinter·2 days ago

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

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

95
Llinlin·2 days ago

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

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

210
Wwinter·2 days ago

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

199
Ttang_haoOP·5 hours ago

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

117
Wwinter·2 days ago

One counter-example: below editor-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.

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

389
Nnikic·just now

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

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

212
Hhuang_keOP·2 days ago

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

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

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

1
Zzhu_zong·3 minutes ago

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

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

139
Bbob_chen·2 days ago

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

31
Zzhu_zong·2 days ago

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

2
Hhuang_ke·2 days agoedited

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

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

340
Nnikic·2 days agoLevel 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.

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

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

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

34
Kkernel_panic·2 days agoLevel 6

One counter-example: below editor-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.

179
Ddev_zhou·just now

One counter-example: below editor-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.

1
Cchen_dev·2 days ago

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

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

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

168
Rran_boOP·2 days agoedited

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

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

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

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

55
Rran_bo·2 days ago

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

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

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

138
Rrase·2 days ago

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

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

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

131
Kkite·2 hours 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.

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

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

39
Nnikic·2 days ago

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

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

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

20
Zzhou_yi·2 hours agoedited

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

232
Rran_bo·just now

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

76
Cchen_devOP·12 minutes ago

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

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

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

112
Cchen_dev·28 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.

87
Nnikic·2 days ago

One counter-example: below editor-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.

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

6
Ddev_zhou·3 minutes ago

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

4
Oops_wang·2 days ago

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

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

8
Zzhou_yi·2 days ago

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

48
Sslow_query·28 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.

41
Rran_bo·2 days ago

One counter-example: below editor-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.

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

97
Cchen_dev·2 days ago

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

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.

19
Mmike_xu·2 days ago

One counter-example: below editor-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.

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

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

32
Zzhu_zong·1 hour ago

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

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

501
Hhuang_ke·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.

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

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

12
Kkite·3 minutes agoedited

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

10
Kkite·just nowedited

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.

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

309
Zzhu_zong·2 days ago

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

428
Cchen_dev·5 hours ago

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

35
Zzhou_yi·12 minutes ago

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

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

174
Cchen_dev·yesterdayedited

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.

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

96
RraseOP·2 days agoLevel 6

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.

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

134
Nnikic·3 minutes agoLevel 6

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

172
Ddev_zhou·5 hours ago

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

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

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

141
Cchen_dev·2 hours ago

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

1
Rran_bo·2 days ago

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

165
NnikicMod·2 days ago

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

5
Aalice_dev·2 days ago

One counter-example: below editor-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
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.

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

3
Cchen_dev·2 days agoedited

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

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

1

This is the post detail page /en/c/editor-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 →