LLM Community · This llm bug hid for three years before anyone reported it

2.0K
LLr/llm·posted by zhu_zong·6 hours agoExperience

This llm bug hid for three years before anyone reported it

It took me two weeks of on-and-off digging and plenty of wrong turns. Writing the process down as it happened so the next person spends less time.

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

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

1047 comments

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

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

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

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

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

413
Ttang_hao·2 days ago

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

1
Oops_wangMod·2 days ago

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

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

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

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

399
NnikicMod·2 days ago

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

31
Zzhou_yi·12 minutes ago

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

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

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

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

83
Mmike_xu·1 hour ago

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

6
Sslow_queryOP·2 days ago

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

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

429
Nnikic·12 minutes 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.

404
Kkernel_panicOP·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.

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

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

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

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

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

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

104
Wwinter·1 hour 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".

349
Ttang_hao·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
Zzhu_zong·2 days ago

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

8
Kkernel_panic·yesterday

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

8
Ttang_hao·2 days ago

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

13
Lli_mingOP·2 days ago

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

322
Zzhou_yi·2 days ago

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

338
Sswoole_leeOP·2 days ago

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

276
Bbob_chenMod·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".

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

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

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

57
Wwinter·2 days ago

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

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

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

94
Oops_wangOP·28 minutes agoedited

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

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

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

300
Aalice_dev·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".

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

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

421
Kkite·3 minutes ago

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

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

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

297
Mmike_xu·2 days ago

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

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

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

223
Rran_boOP·2 days agoedited

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

161
Nnikic·5 hours ago

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

206
Sswoole_leeOP·12 minutes 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.

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

80
KkiteOP·2 days agoedited

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

79
Llinlin·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".

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

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

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

2
Kkernel_panic·2 days agoedited

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

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

106
Oops_wang·12 minutes 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.

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

97
Wwinter·2 days ago

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

88
Oops_wang·2 days ago

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

207
Llinlin·2 days ago

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

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

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

75
Rrase·28 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.

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

513
Sswoole_lee·28 minutes 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.

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

57
Oops_wang·2 days agoedited

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

56
Zzhou_yi·2 days ago

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

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

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

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

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

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

41
Sswoole_lee·5 hours ago

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

129
Ddev_zhouOP·2 days ago

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

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

328
Llinlin·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".

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

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

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

90
Kkernel_panic·2 days ago

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

3
Hhuang_ke·just now

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.

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

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

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

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

38
Zzhou_yi·yesterdayedited

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.

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

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

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

428
Oops_wang·2 days ago

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

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

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

13
Sswoole_lee·just now

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

8
Mmike_xu·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".

343
Cchen_devOP·3 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.

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

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

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

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

1
Llinlin·yesterday

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

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

1
Ttang_hao·2 days ago

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

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

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

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

239
Sslow_query·2 days ago

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

1
Sslow_query·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

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