To run multiple HTTP servers concurrently, use theDocumentation Index
Fetch the complete documentation index at: https://bun.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
reusePort option in Bun.serve() which shares the same port across multiple processes.
This automatically load balances incoming requests across multiple instances of Bun.
Linux only — Windows and macOS ignore the
reusePort option. This is an operating system limitation with
SO_REUSEPORT, unfortunately.SO_REUSEPORT and SO_REUSEADDR socket options to ensure fair load balancing across multiple processes. Learn more about SO_REUSEPORT and SO_REUSEADDR
Bun has also implemented the
node:cluster module, but this is a faster and more limited alternative.