Open Source · Blog · Newbie question: how should a open-source-blog config file be organised?

675
OSr/open-source-blog·posted by kernel_panic·5 minutes agoReview

Newbie question: how should a open-source-blog config file be organised?

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

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.

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

Mmysqlserverteam.comExternal link · opens in a new tab
142 comments

142 comments

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

520
Ttang_hao·2 days ago

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

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

497
Bbob_chen·2 days ago

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

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

422
Kkite·yesterday

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

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

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

383
Hhuang_ke·2 days ago

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

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

359
Sswoole_lee·12 minutes ago

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

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

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

513
Rrase·2 days ago

One counter-example: below open-source-blog 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
Kkite·5 hours ago

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

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

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

291
Zzhou_yi·2 days ago

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

285
Hhuang_ke·1 hour ago

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

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

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

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

6
Kkernel_panic·2 hours ago

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

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

40
Kkite·2 days agoedited

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

141
Zzhou_yi·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_haoOP·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.

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

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

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

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

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

244
Rran_bo·2 days agoedited

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

160
Zzhu_zongOP·2 days ago

One counter-example: below open-source-blog 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
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.

83
Sslow_query·yesterday

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

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

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

192
Ddev_zhou·2 days ago

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

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

372
Hhuang_keOP·2 days agoeditedLevel 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.

36
Zzhou_yi·yesterday

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

131
Kkite·2 days agoeditedLevel 6

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

272
Kkernel_panic·2 days agoLevel 6

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

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

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

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

153
Kkite·5 hours ago

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

459
Ttang_haoOP·2 days agoedited

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

41
Aalice_dev·2 days agoedited

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

412
Nnikic·1 hour ago

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

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

312
Mmike_xuMod·2 days ago

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

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

446
Nnikic·2 days ago

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

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

115
Sswoole_lee·2 days ago

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

7
Wwinter·2 days ago

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

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

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

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

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

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

103
Ddev_zhou·2 days ago

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

500
Rrase·2 days ago

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

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

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

124
RraseMod·2 days ago

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

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

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

97
Ttang_hao·just nowedited

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.

35
Kkite·yesterday

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.

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

55
Cchen_devMod·2 days ago

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

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

48
Hhuang_ke·2 days agoedited

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

47
Sswoole_leeOP·yesterday

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

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

31
Oops_wang·yesterday

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.

26
Cchen_dev·2 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.

25
Rran_bo·2 days ago

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

180
Mmike_xu·2 hours ago

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

77
Sswoole_lee·2 days ago

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

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

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

246
Cchen_dev·just now

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

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

20
Rrase·2 days ago

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

20
Llinlin·3 minutes ago

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

18
Rran_bo·2 days ago

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

51
Nnikic·just now

One counter-example: below open-source-blog 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
Rran_bo·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.

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

47
Zzhu_zong·2 days ago

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

16
Kkernel_panic·2 days ago

One counter-example: below open-source-blog 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
Kkite·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.

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

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

301
Oops_wang·28 minutes ago

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

75
Rrase·2 days ago

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

112
Oops_wang·1 hour agoedited

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

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

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

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

162
Rrase·2 days ago

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

208
Kkernel_panic·2 days ago

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

71
Hhuang_ke·2 days ago

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

68
Rrase·2 days ago

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

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

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

51
Hhuang_keMod·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.

25
Nnikic·yesterday

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_queryOP·just now

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

108
Zzhu_zong·2 hours ago

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

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

3
Kkite·yesterdayLevel 6

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

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

4
Zzhu_zong·12 minutes ago

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

2
Ttang_haoOP·2 days agoedited

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

238
Aalice_dev·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/open-source-blog/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 →