Article
The New Terminal from the Creator of Ghostty Rex running 10000 sessions at once, using only 3.8GB of memory
Beating AI news, Ghostty creator Mitchell Hashimoto has published scalability test results for a new terminal Rex's scalability.Rex It focuses on long-lived sessions and remote connections, allowing terminal tasks to continue running in the background. In this test,Rex were maintained simultaneously, with 10000 active terminal sessions, using approximately 3.8GB of memory while remaining responsive. The team has not tested further upward for now; the next target is 100000 sessions.
After reaching 10000 sessions, much of the overhead is no longer caused by the terminal itself. The first bottleneck comes from Linux's file descriptor table, where the system records files and connections opened by processes. Once the number of terminal sessions exceeds approximately 5000 sessions, each new process uses approximately 512KB more space just for this table, despite actually using only about 4 file descriptors.Rex A section of C code has now been added to shrink this space back to the amount actually required.
The other issue is threads.Rex Previously, each active terminal session occupied one thread waiting for data, creating excessive memory overhead as the scale increased. Now, if a terminal has had no read activity for 2 seconds, it is handed off to a shared thread for unified monitoring.
Original link https://m.theblockbeats.info/flash/370788