tmux · Advanced · Built a visual debugging panel for tmux-pro over the weekend

2.2K
TMr/tmux-pro·posted by linlin·2 hours agoInternals

Built a visual debugging panel for tmux-pro over the weekend

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.

What genuinely surprised me was the tail. The average looked great while P99 jumped by an order of magnitude past some threshold. The cause was not tmux-pro itself but our upstream connection reuse — the load test traffic was too clean and hid the long-tail requests.

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

314 comments

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

513
Nnikic·2 days ago

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

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

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

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

69
Bbob_chen·2 hours ago

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

126
Kkernel_panic·2 days ago

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

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

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

33
Oops_wangMod·2 days ago

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

442
WwinterOP·2 days ago

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

375
Ttang_haoOP·2 days ago

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

289
Sswoole_lee·5 hours ago

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

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

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

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

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

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

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

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

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

305
Nnikic·2 days ago

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

267
Llinlin·2 days ago

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

37
Zzhou_yi·2 days ago

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

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

256
Zzhu_zong·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
Mmike_xu·2 days ago

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

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

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

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

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

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

432
Kkernel_panic·2 hours ago

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

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.

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

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

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

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

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

190
Bbob_chen·2 days ago

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

200
Kkernel_panic·2 days ago

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

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

110
Lli_mingOP·2 days ago

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

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

162
Hhuang_ke·2 days ago

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

137
Bbob_chen·2 days ago

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

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

111
Sslow_query·28 minutes ago

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

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

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

32
Ddev_zhou·2 days agoedited

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

171
Aalice_dev·2 days ago

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

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

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

66
KkiteOP·2 hours 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.

163
Bbob_chen·2 hours ago

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

255
Zzhou_yi·2 days ago

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

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

270
Kkernel_panicOP·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
LlinlinMod·2 days ago

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

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

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

4
Oops_wang·2 days ago

One counter-example: below tmux-pro 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
Cchen_dev·2 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.

47
Sswoole_leeOP·12 minutes ago

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

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

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

30
Rran_bo·2 days agoedited

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

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

204
Ddev_zhou·1 hour 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.

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

12
Bbob_chenOP·2 days ago

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

1
Hhuang_keOP·12 minutes ago

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

30
Sswoole_lee·2 days agoLevel 6

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

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

62
Kkernel_panic·3 minutes ago

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

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

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

239
Mmike_xu·2 days ago

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

202
Kkernel_panic·12 minutes ago

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

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

274
Sswoole_lee·2 days ago

One counter-example: below tmux-pro 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
Kkite·2 days agoLevel 6

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

124
Mmike_xu·2 days ago

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

1
Wwinter·12 minutes ago

One counter-example: below tmux-pro 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
Mmike_xu·5 hours ago

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

83
Ddev_zhou·2 days ago

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

141
Mmike_xu·just now

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

13
Sswoole_lee·just nowedited

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

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

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

66
Sswoole_lee·2 days agoedited

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

60
Rran_bo·2 days ago

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

58
Nnikic·2 days ago

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

56
Nnikic·2 days ago

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

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

50
Rran_bo·2 days ago

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

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

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

One counter-example: below tmux-pro 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
Rrase·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.

39
Wwinter·2 days ago

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

32
Zzhu_zong·2 days ago

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

32
Kkernel_panic·2 hours ago

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

28
Rrase·yesterday

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

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

21
Ddev_zhou·1 hour ago

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

18
Aalice_dev·2 days ago

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

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

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

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

139
Ddev_zhou·yesterday

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

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

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

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

1
Rrase·3 minutes ago

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

3
Lli_ming·12 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.

177
Sslow_query·just now

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

1
Kkite·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
Llinlin·2 days ago

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

266

This is the post detail page /en/c/tmux-pro/post/p12. 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 →