TensorRT · Beginners · Choosing tensorrt-newbie: I turned 5 options into a side-by-side comparison

2.0K
TEr/tensorrt-newbie·posted by chen_dev·32 minutes agoReview

Choosing tensorrt-newbie: I turned 5 options into a side-by-side comparison

Most tensorrt-newbie 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.

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

Mmysqlserverteam.comExternal link · opens in a new tab
960 comments

960 comments

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

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

462
Oops_wang·3 minutes ago

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

487
Cchen_devOP·28 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.

413
Sslow_query·2 days ago

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

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

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

365
Zzhu_zong·2 days ago

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

424
Wwinter·2 days ago

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

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

249
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
Ddev_zhou·2 days ago

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

1
Aalice_dev·28 minutes ago

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

359
Hhuang_ke·just now

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

313
Cchen_dev·2 hours ago

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

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

310
Zzhu_zong·2 days ago

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

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

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

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

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

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

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

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

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

212
RraseOP·2 days ago

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

184
Sswoole_lee·yesterday

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

220
Sswoole_lee·2 days ago

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

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

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

186
Aalice_dev·2 days ago

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

5
Zzhou_yi·28 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.

318
Lli_ming·2 days ago

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

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

251
Mmike_xu·2 days ago

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

393
Llinlin·2 days ago

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

3
Nnikic·2 days ago

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

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

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

280
Zzhou_yi·28 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.

189
Nnikic·just now

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

203
Ttang_hao·2 days ago

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

495
Nnikic·2 days ago

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

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

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

116
Hhuang_ke·3 minutes ago

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

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

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

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

187
Sswoole_lee·2 hours ago

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

14
Sslow_query·28 minutes agoedited

One counter-example: below tensorrt-newbie 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
Rran_bo·2 days ago

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

494
Aalice_devOP·2 days ago

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

60
Kkernel_panic·2 days ago

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

213
Lli_ming·2 days ago

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

72
Aalice_dev·2 days agoLevel 6

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

6
Rran_bo·2 days agoedited

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

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

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

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

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

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

140
Bbob_chen·2 days ago

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

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

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

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

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

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

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

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

41
Sslow_query·2 days ago

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

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

89
Sswoole_lee·yesterday

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

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

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

34
Mmike_xu·2 days ago

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

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

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

15
NnikicOP·2 days agoedited

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

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

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

53
Lli_ming·12 minutes ago

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

41
Mmike_xu·12 minutes ago

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

452
Hhuang_ke·5 hours ago

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

174
Ddev_zhouMod·yesterday

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

41
Lli_ming·2 days ago

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

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

31
Ttang_hao·2 days ago

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

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

23
Aalice_dev·2 days ago

One counter-example: below tensorrt-newbie 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
Zzhu_zongMod·2 days agoedited

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

37
Llinlin·yesterday

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

9
Nnikic·2 days ago

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

308
Rran_bo·5 hours ago

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

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

1
Kkernel_panic·3 minutes ago

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

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

382
Sslow_query·yesterday

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.

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

248
Cchen_dev·2 days ago

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

8
Aalice_dev·2 days ago

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

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

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

237
KkiteMod·2 days ago

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

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

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

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

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

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

104
Kkernel_panic·2 days agoedited

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

2
Hhuang_ke·2 hours ago

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

82
Nnikic·2 days ago

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

2
Sswoole_lee·2 days ago

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

2
NnikicOP·2 days ago

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

206
Sslow_queryOP·2 days ago

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

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

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

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

9
Sswoole_lee·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/tensorrt-newbie/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 →