LLM Community · Those easily-missed type details in llm

2.4K
LLr/llm·posted by zhou_yi·just nowJobs

Those easily-missed type details in llm

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

Order of investigation, by return on effort: 1. Check downstream latency first — usually it is not your problem 2. Then pool hit rate and wait-queue length 3. Only then GC and allocation 4. Suspect the framework last

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.

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

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.

1066 comments

1066 comments

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

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

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

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

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

388
Zzhu_zong·3 minutes agoedited

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

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

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

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

221
Bbob_chen·2 days ago

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

408
Rran_bo·2 days ago

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

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

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

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

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

311
Llinlin·28 minutes ago

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

277
Wwinter·3 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.

273
Ddev_zhouOP·yesterday

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

193
LlinlinMod·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.

240
Rrase·yesterday

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

235
WwinterOP·2 days ago

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

174
Cchen_dev·1 hour ago

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

233
Zzhu_zong·28 minutes ago

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

233
Ttang_hao·2 hours 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.

208
Rran_boOP·2 days ago

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

132
Ddev_zhou·2 days agoedited

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

141
Ttang_hao·28 minutes ago

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

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

132
Rrase·3 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.

121
Hhuang_ke·2 days agoedited

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

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

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

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

103
Rrase·2 days ago

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

518
Lli_ming·2 days ago

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

296
Sswoole_lee·28 minutes ago

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

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

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

56
Sslow_query·2 days ago

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

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

125
Ttang_hao·just now

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.

225
Rrase·2 days ago

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

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

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

85
Mmike_xuOP·2 days agoLevel 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.

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

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

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

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

83
Kkernel_panic·2 days ago

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

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

66
Zzhu_zong·2 days ago

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

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.

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

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

62
Nnikic·2 days ago

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

43
Ttang_hao·2 days ago

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

209
Sslow_query·2 hours ago

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

40
Sswoole_lee·5 hours ago

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

39
Bbob_chen·yesterdayedited

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

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

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

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

145
Hhuang_keOP·3 minutes ago

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

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

28
Rrase·2 days ago

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

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

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

1
Kkite·3 minutes ago

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

15
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
Aalice_dev·just now

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

37
Lli_ming·yesterday

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

438
Mmike_xu·2 days ago

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

302
Llinlin·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
Oops_wang·2 days ago

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

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

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

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

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

401
Ttang_hao·2 days ago

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

28
Bbob_chen·2 days agoLevel 6

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

51
Wwinter·2 days ago

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

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

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

341
KkiteMod·2 days ago

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

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

52
Lli_ming·2 days ago

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

222
Aalice_dev·2 hours ago

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

1
Llinlin·2 hours ago

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

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

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

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

28
Cchen_dev·2 days ago

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

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

14
Hhuang_ke·1 hour agoedited

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

12
Llinlin·2 days ago

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

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

9
Sswoole_lee·2 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.

329
Llinlin·3 minutes ago

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

172
Zzhou_yi·2 days agoedited

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

185
Hhuang_ke·2 days ago

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

138
Oops_wang·12 minutes ago

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

88
Nnikic·2 days ago

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

26
Llinlin·3 minutes ago

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

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

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

1
Bbob_chen·2 days ago

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

1
Hhuang_ke·2 days ago

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

39
Sswoole_lee·3 minutes ago

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

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

22
Mmike_xu·2 days ago

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

125
Rran_bo·3 minutes ago

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

401
Mmike_xu·2 days ago

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

129
Zzhu_zong·5 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.

5
Zzhu_zong·28 minutes ago

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

4
Ttang_hao·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
Rrase·2 days ago

One counter-example: below llm 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
Wwinter·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.

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

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

1

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