LLM Community · Two weeks with llm: what feels right and what drives me up the wall

493
LLr/llm·posted by nikic·5 minutes agoInternalsPinned

Two weeks with llm: what feels right and what drives me up the wall

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.

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.

Self-host — full control44%
Managed service — less work28%
Hybrid: core self-hosted17%
Not decided yet11%

838 votes total

91 comments

91 comments

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

516
Ddev_zhouMod·2 days agoedited

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

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

482
WwinterMod·2 days ago

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

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

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

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

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

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

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

403
Sswoole_leeMod·2 days ago

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

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

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

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

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

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

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

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

274
Zzhu_zong·3 minutes agoedited

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

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

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

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

181
Kkite·2 days ago

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

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

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

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

354
Rran_bo·12 minutes ago

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

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

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

86
Cchen_dev·yesterday

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

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

50
Bbob_chenOP·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".

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

26
Lli_ming·2 days ago

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

92
Zzhu_zongOPMod·28 minutes 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.

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

336
Kkernel_panic·2 days ago

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

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

1
Zzhou_yi·2 days ago

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

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

13
Rran_bo·28 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".

2
KkiteOP·3 minutes ago

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

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

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

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

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

11
Nnikic·2 hours ago

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

218
Rran_bo·2 hours ago

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

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

76
NnikicOPMod·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.

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

132
Sslow_query·2 days agoedited

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

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

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

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

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

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

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

41
Aalice_dev·2 days ago

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

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

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

16
Ttang_hao·5 hours 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.

199
Zzhu_zong·just nowedited

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

210
Ddev_zhou·2 days ago

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

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

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

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

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

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

7
Lli_mingOP·2 days ago

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

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

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

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

169
Kkite·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".

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

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

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

5
Aalice_dev·2 days ago

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

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

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

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

16
Llinlin·2 days ago

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

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

9
Cchen_dev·2 days agoedited

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

375
Zzhou_yi·2 days ago

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

6
Nnikic·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
Rrase·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

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

290
Wwinter·2 days ago

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

188
Mmike_xu·2 days ago

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

1

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