CLI Tools · Career · cli-tools-career under load on an 8-core 16GB box — full benchmark scripts included

1.6K
CTr/cli-tools-career·posted by tang_hao·6 hours agoHelpLocked

cli-tools-career under load on an 8-core 16GB box — full benchmark scripts included

Some background first. Our setup is cli-tools-career 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.

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

700 comments

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

487
Wwinter·2 days ago

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

477
Wwinter·2 hours ago

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

472
Oops_wang·2 days ago

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

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

4
Aalice_dev·2 hours ago

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

436
Cchen_dev·2 days ago

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

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

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

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

1
Kkite·3 minutes agoedited

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

496
Aalice_dev·2 days ago

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

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

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

63
Llinlin·2 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.

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

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

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

29
Ttang_hao·2 days agoLevel 6

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

107
Llinlin·yesterdayLevel 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.

34
Kkernel_panic·2 days agoLevel 6

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

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

5
Rran_bo·2 days ago

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

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

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

1
Cchen_dev·2 days ago

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

385
Cchen_dev·2 days ago

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

306
NnikicOP·2 days ago

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

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

348
Rrase·2 days ago

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

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

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

274
Hhuang_ke·2 days ago

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

261
Rrase·2 days ago

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

230
Rran_bo·2 days ago

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

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

318
Zzhou_yi·2 days ago

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

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

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

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.

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

200
Bbob_chenMod·yesterday

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

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

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

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

57
Sswoole_lee·2 days agoedited

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

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

92
Cchen_dev·5 hours agoedited

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

53
Bbob_chen·2 days ago

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

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

59
Cchen_dev·just now

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

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

303
Rran_bo·2 days agoedited

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

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

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

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

192
Wwinter·1 hour ago

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

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

221
Ddev_zhou·2 days ago

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

89
Rran_boMod·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.

15
Ddev_zhou·2 days ago

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

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.

1
Ddev_zhou·yesterdayedited

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

52
Oops_wang·2 days ago

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

44
Nnikic·2 days ago

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

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

50
Kkernel_panic·2 hours ago

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

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

254
Sswoole_leeOP·2 days ago

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

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

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

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

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

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

2
Ddev_zhou·2 days agoLevel 6

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

7
Wwinter·2 days ago

One counter-example: below cli-tools-career 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
Ddev_zhou·2 days ago

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

57
Sswoole_lee·2 days ago

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

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

102
Ddev_zhou·2 days ago

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

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

23
Kkite·2 days agoLevel 6

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

239
Bbob_chen·2 days agoLevel 6

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

38
Rran_bo·just now

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

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

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

271
Oops_wang·just now

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

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

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

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

282
Llinlin·just now

One counter-example: below cli-tools-career 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
Zzhou_yi·3 minutes ago

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

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

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

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

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

451
Sswoole_lee·2 days ago

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

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

105
Llinlin·2 days ago

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

79
Ddev_zhou·2 days ago

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

53
Lli_ming·2 days ago

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

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

432
Lli_ming·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
Zzhou_yiOP·2 days ago

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

311
Wwinter·1 hour ago

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

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

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

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

97
Cchen_dev·5 hours agoedited

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

77
Hhuang_ke·2 days ago

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

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

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

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

1
Wwinter·2 days ago

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

1
RraseOP·2 days agoedited

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

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

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

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

1

This is the post detail page /en/c/cli-tools-career/post/p12. 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 →