Configuration Reference#
mudud reads its configuration from a TOML file. The file controls listen ports, execution mode, storage paths, and io_uring behavior.
File location#
The server loads the first file that exists, in this order:
The path provided by
--cfg /path/to/mudud.cfg(or-c /path/to/mudud.cfg), if given../mudud.cfgin the current working directory.~/.mududb/mudud.cfgin the user’s home directory.
If none of these files exist, mudud returns a NotFound error. Use mudud init-cfg to create a default ./mudud.cfg before starting the server.
Generate a default config#
mudud init-cfg
Configuration fields#
Field |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Path to the application package directory. |
|
string |
|
Path to the database directory. |
|
string |
|
IP address to listen on. |
|
u16 |
|
HTTP management API port. |
|
usize |
|
HTTP worker thread count. |
|
u16 |
|
PostgreSQL wire protocol port. |
|
string |
|
Wasm component ABI target. Allowed: |
|
boolean |
|
Enable the WASI component runtime. |
|
string |
|
|
|
u16 |
|
TCP framed protocol port. |
|
boolean |
|
One TCP listener per worker. |
|
usize |
|
Worker thread count. |
|
u32 |
|
io_uring completion queue depth. |
|
boolean |
|
Enable io_uring accept multishot. |
|
boolean |
|
Enable io_uring recv multishot. |
|
boolean |
|
Enable io_uring fixed buffers. |
|
boolean |
|
Enable io_uring fixed files. |
|
string |
|
|
|
u64 |
|
io_uring log chunk size in bytes. |
|
usize |
|
Database page size in bytes. Persistent: changing it for an existing database requires migration or re-initialization. |
Server and routing modes#
server_mode: controls the backend I/O/runtime path.Legacy: traditional blocking I/O path for maximum compatibility.IOUring: Linux io_uring based high-performance async I/O.Tokio: Tokio-based async runtime.
routing_mode: controls how requests are routed to workers.ConnectionId(default): route based on connection identifier.PlayerId: route based on an application-level player/user identifier.RemoteHash: hash-based routing using remote address or hashed key.
Example mudud.cfg#
mpk_path = "./mpk"
db_path = "./data"
listen_ip = "127.0.0.1"
http_listen_port = 8300
http_worker_threads = 1
pg_listen_port = 5432
tcp_listen_port = 9527
server_mode = "Tokio"
worker_threads = 0
io_uring_ring_entries = 1024
io_uring_accept_multishot = true
io_uring_recv_multishot = true
io_uring_enable_fixed_buffers = false
io_uring_enable_fixed_files = false
routing_mode = "ConnectionId"
enable_async = true
tcp_multi_port = false
log_chunk_size = 67108864
page_size = 4096
See the Server Configuration Contract for compatibility and upgrade rules.