Originally published on 2026-01-28
Original article (Japanese): 並列でセッション管理: tmuxの代替を探したら結局tmuxが最強だった
“Isn't tmux a bit heavy? Is there something lighter?”
While running open-source code for AI development in 100 parallel sessions, I found myself wondering this. tmux is the go-to session management tool, but its binary size is large, and I thought there might be simpler and lighter tools available. So, I decided to try out various alternatives to tmux.
In conclusion, for 100 parallel sessions, tmux is the lightest option.
Candidates
I researched the following tools as alternatives to tmux.
zmx
- Language: Zig
- Features: Focused solely on session persistence, with terminal state restoration
- Binary Size: 1.5MB
- Dependencies: None (statically linked)
shpool
- Language: Rust
- Features: Terminal state restoration, manages all sessions on one server
- Binary Size: Not measured (excluded this time)
- Drawback: Does not support multiple clients connecting simultaneously
abduco
- Language: C
- Features: Extremely lightweight, session listing feature available
- Binary Size: 52KB
- Drawback: No terminal state restoration (screen disappears on reconnection)
dtach
- Language: C
- Features: Minimal and lightweight, only the detach feature from screen
- Binary Size: 52KB
- Drawback: No terminal state restoration, no session listing feature
Actual Measurements
I installed the tools and measured their binary sizes and memory usage.
Binary Size
| Tool | Binary Size | Dependency Libraries |
|---|---|---|
| dtach | 52KB | Only libutil |
| abduco | 52KB | Only libutil |
| tmux | 886KB | 4 libraries including libevent, ncurses |
| zmx | 1.5MB | None (statically linked) |
Both dtach and abduco are overwhelmingly small. zmx is larger than tmux because it includes libghostty-vt.
Memory per Session
I created 5 sessions and measured the memory usage per session.
| Tool | Memory/Session | Terminal State Restoration |
|---|---|---|
| dtach | ~1MB | ✗ |
| abduco | ~0.9MB | ✗ |
| tmux | ~2.2MB | ✓ |
| zmx | ~11MB | ✓ |
When looking at just one session, dtach and abduco are significantly lighter. zmx uses more memory due to its terminal state restoration feature relying on libghostty-vt.
What Happens with 100 Parallel Sessions?
Now, onto the main topic. I created 100 sessions and measured the memory usage.
# tmux: Create 100 sessions
for i in $(seq 1 100); do
tmux new-session -d -s "bench-$i" "sleep 600"
done
# dtach: Create 100 sessions
for i in $(seq 1 100); do
dtach -n /tmp/dtach-bench/session-$i.sock sleep 600
done
# abduco: Create 100 sessions
for i in $(seq 1 100); do
abduco -n "abduco-bench-$i" sleep 600
done
Here are the results.
| Tool | Total Memory for 100 Sessions |
|---|---|
| tmux | 26MB |
| dtach | 98MB |
| abduco | 92MB |
The surprising result is that tmux is overwhelmingly lighter.
Why Does tmux Win?
The reason lies in the architectural differences.
flowchart TB
subgraph tmux["tmux: Shared by 1 Server"]
direction TB
Server[tmux server<br/>1 process]
Server --> S1[session 1]
Server --> S2[session 2]
Server --> S3[...]
Server --> S100[session 100]
end
subgraph dtach["dtach/abduco: Independent per Session"]
direction TB
D1[dtach 1<br/>1 process]
D2[dtach 2<br/>1 process]
D3[...]
D100[dtach 100<br/>1 process]
end
tmux: A single server process manages all sessions → Overhead remains small even as the number of sessions increases.
dtach/abduco: Each session runs as an independent process → Memory increases proportionally with the number of sessions.
While dtach and abduco are lightweight "per session," tmux's design of "one server managing everything" excels when dealing with a large number of sessions.
Summary
After searching for alternatives to tmux and trying dtach, abduco, and zmx, I found that for a large number of sessions, like 100 in parallel, tmux is the lightest option.
It was an unexpected result of "looking light but actually..." However, understanding the architecture makes it clear.
Conclusion: tmux is just fine
Here’s a summary based on use cases:
| Use Case | Optimal Solution |
|---|---|
| 1-10 sessions | Anything OK (choose based on preference) |
| 100 parallel sessions | tmux |
| Want full terminal functionality | tmux (or settle for zmx) |
| Absolute requirement for ultra-light | dtach/abduco (but screen disappears on reconnection) |
If you need to manage 100 parallel sessions in AI development, I would straightforwardly use tmux.
Top comments (0)