I am building terminal servers to handle large numbers of terminals and clients, with memory use and responsiveness as central engineering concerns. My work spans qualitative comparisons with other multiplexers, memory-optimization techniques in Superlogical, and measured scalability work on Rex.
I built Superlogical’s server to run anywhere and everywhere and serve a level of scale (terminals+clients) unmatched w/ prior solutions.
I said we were seeing unprecedented terminal usage and client attachment mainly due to AI; AI systems spawn more sessions, each its own client, and optimizing for this also benefits people who do not use AI or agents.
I said Superlogical has an early breakpoint with busy terminals and clients where it uses significantly less memory than tmux or anyone else, while tmux has excellent memory use in empty states.
I described Zellij’s default out-of-the-box empty footprint as high and its per-client attachment as unscalable; I characterized its current form as intended for “smal single-human low-terminal-count scale.”
I found that Zellij’s zero-configuration setup has tab-bar and status-bar WASM plugins, with an instantiation for each tab. Each instantiation is its own wasm runtime. I called the resulting memory use a “Huge memory explosion.”
I noticed that the memory was never reclaimed when I closed the tabs, even when waiting for minutes for memory to settle, and I did not investigate further.
I respect the tmux project and said they've been really receptive to the bugs I've found via Ghostty or the protocols we've championed.
I said a follow-up video would explain more about how we achieve Superlogical’s memory results.
I described a handful of the tricks we use to optimize memory within the Superlogical server, including in-memory compression.
I named moving file descriptors between event-driven and blocked threads dynamically as one of the Superlogical server’s memory-optimization techniques.
I said we can binary-snapshot and restore full terminal state in microseconds.
I reported that we ran 10,000 active terminals simultaneously with 3.8 GB memory usage while maintaining responsiveness on Rex.
I said we had not tried more than 10,000 terminals yet, wanted to improve some numbers before going bigger, and had a goal of 100,000.
I explained that Linux fork preallocates fd-table space based on the highest open fd, rounded to the nearest power of 2; beyond about 5,000 terminals, this meant 512KB per terminal process JUST for a fd table that had ~4 fds.
I said we use a trampoline written in C to unshare the fd table so it shrinks to fit the minimum fds.
I said that previously all active, non-snapshot terminals blocked on PTY reads; it takes up an OS thread which at this scale uses a prohibitively high amount of RAM.
I said we now move quiet PTY file descriptors, defined as having 2 seconds without read activity, to a shared epoll thread.
I did not compare Rex with other multiplexers at that time; the enemy I was trying to beat was myself, and I said these are still alpha-quality builds.
My terminal-state memory work on individual terminal grids is documented in terminal memory layout. These server-scale comparisons and results concern the server and its clients, rather than only the memory representation of a terminal grid.
Related: multiplexer design and compatibility, terminal performance engineering, kitty protocol support