HLSL · Performance · hlsl-perf under load on an 8-core 16GB box — full benchmark scripts included

238
HLr/hlsl-perf·posted by linlin·2 days agoReview

hlsl-perf under load on an 8-core 16GB box — full benchmark scripts included

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

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.

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

110 comments

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

510
Mmike_xuOP·2 days ago

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

443
Ttang_hao·2 days ago

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

477
Mmike_xu·2 days ago

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

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

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

264
Kkernel_panic·2 days ago

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

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

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

99
Ttang_hao·just now

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

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

292
Rran_bo·2 days ago

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

91
Ddev_zhou·2 days ago

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

269
Mmike_xu·2 days ago

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

250
Hhuang_keOP·5 hours agoedited

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

151
Cchen_dev·12 minutes 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.

184
Nnikic·2 hours ago

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

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

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

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

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

127
Wwinter·12 minutes ago

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

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

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

12
Wwinter·2 days ago

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

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

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

342
Oops_wang·2 days ago

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

75
Kkite·2 days ago

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

219
Zzhu_zong·3 minutes 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.

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

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

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

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

303
Ddev_zhou·2 days ago

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

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

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

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

49
Mmike_xu·2 days ago

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

71
Oops_wang·2 days ago

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

8
Aalice_devOP·28 minutes agoLevel 6

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

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

286
Zzhou_yi·12 minutes agoLevel 6

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

120
Rran_bo·2 days agoLevel 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.

52
Zzhou_yi·3 minutes agoLevel 6

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

33
Mmike_xu·2 days agoLevel 6

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

25
Sswoole_lee·28 minutes agoedited

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

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

1
Sslow_query·28 minutes agoedited

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

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

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

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

192
Kkite·5 hours ago

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

19
Ttang_hao·just now

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

21
NnikicOP·2 days ago

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

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

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

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

82
Llinlin·5 hours ago

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

8
Bbob_chenOP·yesterdayedited

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.

496
Lli_ming·2 days ago

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

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

321
Lli_ming·2 days agoLevel 6

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

250
Sswoole_lee·2 days agoLevel 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.

19
NnikicMod·2 days ago

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

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

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

414
Sswoole_lee·2 days agoLevel 6

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

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

334
Ddev_zhou·2 days agoLevel 6

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

382
Lli_ming·2 days agoLevel 6

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

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

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

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

26
Oops_wang·2 days ago

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

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

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

107
Llinlin·2 days agoedited

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

82
Lli_mingOP·5 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.

45
Mmike_xu·2 days ago

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

301
Zzhou_yi·2 days ago

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

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

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

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

1
Sslow_query·2 days ago

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

72
Ddev_zhou·2 days ago

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

67
Aalice_devOP·2 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.

4
Ddev_zhouMod·2 days ago

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

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

44
Sswoole_lee·3 minutes ago

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

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

19
Nnikic·2 days ago

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

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

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

17
Sslow_query·2 days ago

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

15
Zzhou_yi·1 hour 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
Kkite·2 days ago

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

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

299
Wwinter·2 days ago

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

155
Hhuang_ke·2 days ago

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

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

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

96
Rran_bo·2 days ago

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

252
Zzhu_zong·28 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.

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

49
Hhuang_ke·2 days ago

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

29
Ttang_hao·12 minutes ago

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

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

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

1

This is the post detail page /en/c/hlsl-perf/post/p10. 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 →