tephra-server 0.1.0

Synchronous, thread-per-connection TCP server exposing a tephra event store over the length-prefixed protobuf protocol
# Example tephra-server configuration.
#
# Every value shown is the built-in default, so an empty file behaves identically to running
# with no config at all. Pass this file with `--config tephra.example.toml`. Any key can also
# be set from the environment as TEPHRA__<SECTION>__<KEY>, upper-cased, e.g.
# TEPHRA__WRITER__MAX_BATCH_BYTES=16777216. The command line only carries --bind, --data-dir,
# and --log, and those override whatever is set here.

# Address the TCP listener binds.
bind = "127.0.0.1:9000"
# Directory holding the log (and index) segment files.
data_dir = "tephra-data"
# Tracing filter. Omit to fall back to RUST_LOG, then to "info".
# log = "tephra=debug"

[segment]
# Total size of each segment file in bytes, including its header.
size = 268435456           # 256 MiB

[writer]
# Bounded request-queue depth. When full, an append blocks (backpressure).
queue_capacity = 1024
# Most requests folded into one group-committed batch. The main throughput-vs-latency dial.
max_batch_records = 1024
# Byte budget for one batch. Clamped down to the segment capacity at startup, so it can never
# exceed a shrunk segment.size.
max_batch_bytes = 8388608  # 8 MiB
# Recent-position window width for the durable tips map (a memory bound only).
tips_window = 1000000
# Resolve the append-condition durable arm with the log scan instead of the index existence
# check. An operational escape hatch: the log is the source of truth, so the scan is always
# safe, just slower.
condition_force_scan = false

[read]
# The planner's K: the index is chosen only when the post-pruning range is at least scan_bias
# times the estimated result count, so larger values bias toward scanning at the margin. This
# only changes which correct path runs, never the answer.
scan_bias = 4

[server]
# Largest single frame accepted or produced, in bytes.
max_frame_len = 16777216   # 16 MiB
# A streamed read (or subscription) is flushed as a frame once it holds this many events.
read_batch_events = 1024
# A streamed read (or subscription) is flushed as a frame once its buffered events reach this
# many bytes.
read_batch_bytes = 524288  # 512 KiB
# How often an idle subscription's blocking wait wakes to re-check server shutdown, in
# milliseconds. Keeps a subscription with no events flowing responsive to shutdown without a
# heartbeat frame.
subscribe_wait_tick_ms = 250
# TCP keepalive idle time before the first probe on an accepted connection, in seconds. The OS
# default (~2h on Linux) is too long to reap a silently-dead subscription promptly.
keepalive_idle_secs = 60
# Interval between TCP keepalive probes once they start, in seconds.
keepalive_interval_secs = 15