It’s quiet, but it matters. This port is the thread between the Mercurial client and its internal server processes, a narrow channel for control, data, and performance. Ignore it, and you risk bottlenecks or exposure. Understand it, and you control the flow.
In Mercurial, the internal port acts as the interface for background operations that avoid direct file I/O. Certain commands, especially those using serve or experimental extensions, use this port to coordinate tasks. It’s local by default, bound only to your machine, but configuration mistakes can make it accessible externally. That’s the moment where speed meets security risk.
By standard design, Mercurial assigns the internal port dynamically to prevent collisions. You can override it by setting --port in hg serve or adjusting your hgrc configuration. The key is awareness: know which processes are using the port, confirm binding addresses, and monitor for unexpected listeners. When debugging performance issues, tracing the internal port traffic can reveal idle delays, cache misses, or blocked requests in real time.