App Design · News · Newbie question: how should a app-design-news config file be organised?

1.9K
ADr/app-design-news·posted by dev_zhou·3 days agoInternalsPinned

Newbie question: how should a app-design-news config file be organised?

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

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.

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.

Sstackoverflow.comExternal link · opens in a new tab
371 comments

371 comments

· first 120 loaded
M
Ttang_hao·2 days ago

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

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

470
Nnikic·2 days agoedited

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

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

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

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

363
Bbob_chen·2 days ago

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

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.

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

309
Ddev_zhou·2 days ago

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

207
Bbob_chen·just now

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

317
Aalice_dev·2 days ago

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

292
Lli_ming·2 days ago

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

18
Kkite·2 days ago

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

276
Kkite·2 days ago

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

271
Oops_wang·2 days ago

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

248
Kkite·5 hours ago

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

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

403
Rran_boOP·2 days ago

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

140
Rran_bo·2 days agoedited

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

191
Ttang_hao·2 days agoedited

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

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

214
Ddev_zhouOP·2 days ago

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

122
Kkite·2 days ago

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

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

166
Hhuang_ke·3 minutes ago

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

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

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

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

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

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

31
Rrase·2 days agoedited

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

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

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

143
Lli_ming·yesterday

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.

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

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

139
Llinlin·12 minutes agoedited

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

131
Oops_wang·2 days ago

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

68
Lli_ming·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
Rran_boOP·2 days ago

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

100
Sslow_query·2 days ago

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

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

100
Sslow_query·2 days ago

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

159
Sswoole_lee·2 days ago

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

192
Bbob_chenMod·2 days ago

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

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

9
KkiteOP·2 days agoedited

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

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

142
Rrase·2 days ago

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

19
Rran_bo·2 days ago

One counter-example: below app-design-news 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
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.

415
Ttang_haoOP·2 days ago

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

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

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

108
Llinlin·2 days agoedited

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

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

88
Lli_ming·2 days ago

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

75
Mmike_xu·2 days ago

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

67
Wwinter·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
Nnikic·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.

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

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

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

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

24
Llinlin·2 days ago

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

22
Llinlin·2 days ago

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

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

15
Oops_wang·1 hour 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.

258
Rrase·2 days ago

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

86
Nnikic·2 days ago

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

19
Bbob_chen·12 minutes ago

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

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

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

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

1
Kkite·2 days ago

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

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

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

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

196
Kkite·2 days ago

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

338
Ddev_zhou·yesterday

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

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

332
Llinlin·just nowLevel 6

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

418
Aalice_dev·2 days agoeditedLevel 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.

80
Rran_boOP·yesterdayLevel 6

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

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

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

95
Ddev_zhou·2 days ago

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

1
Sslow_query·2 days ago

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

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

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

463
Cchen_dev·2 days ago

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

62
Kkernel_panic·5 hours ago

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

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

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

450
Rrase·2 days agoeditedLevel 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.

450
Llinlin·2 days ago

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

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

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

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

45
Ttang_hao·5 hours ago

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

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

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

358
Kkite·yesterdayeditedLevel 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.

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

36
Sswoole_lee·2 days ago

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

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

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

17
Kkite·5 hours 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.

121
Aalice_dev·2 days ago

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

9
Lli_mingMod·12 minutes ago

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

9
Hhuang_ke·2 days agoedited

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

29
Lli_ming·2 days ago

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

8
Rrase·5 hours agoedited

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

8
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
Hhuang_ke·2 days ago

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

43
Zzhu_zong·2 days ago

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

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

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

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

2

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