reusePort option in Bun.serve(). It shares one port across multiple processes, and incoming requests are load balanced across them.
Linux only — Windows and macOS ignore the
reusePort option. This is an operating system limitation with
SO_REUSEPORT.reusePort uses the Linux SO_REUSEPORT and SO_REUSEADDR socket options to ensure fair load balancing across processes. Learn more about SO_REUSEPORT and SO_REUSEADDR
Bun also implements the
node:cluster module; reusePort is a faster but more limited alternative.