Running the daemon¶
secantusd-rs --host 127.0.0.1 --port 27017 --storage-path ./secantus-data
The daemon prints secantusd-rs listening on <host>:<port> once the accept
loop is up (launchers can parse that line), runs until SIGINT/SIGTERM, and
shuts WiredTiger down cleanly on exit. --port 0 binds an OS-assigned
port. Bad arguments exit 2; --help / --version exit 0.
CLI flags¶
Both --flag value and --flag=value spellings work.
Flag |
Meaning |
Default |
|---|---|---|
|
Explicit |
auto-discovered |
|
Bind address |
|
|
TCP port ( |
|
|
WiredTiger home directory (created if absent) |
|
|
|
|
|
WiredTiger cache, unit-suffixed ( |
|
|
Max concurrent WiredTiger sessions (≈ client connections) |
|
|
fsync every commit (closes the |
off |
|
Persist oplog entries via a background drainer pool instead of inside each write’s commit (higher write throughput; change-stream events surface once drained) |
off, or |
|
Create oplog tables |
off, or |
|
mongod’s split: WAL-log only the oplog; data tables recover by oplog replay from the last stable checkpoint (see Recovery) |
off, or |
|
Seconds between checkpoints. A checkpoint is what trims the log, and under |
|
|
Require SCRAM authentication on every non-handshake command |
off |
|
Advertise a plain standalone |
off |
|
Periodic oplog no-op so cluster time advances while idle (mongod default is 10s) |
|
|
Oplog retention window |
|
|
Oplog entry cap (whichever cap hits first prunes oldest) |
|
|
Archive pruned oplog rows for point-in-time recovery beyond the live window |
off |
|
Server certificate (PEM); pair with |
off |
|
Server private key (PEM) |
off |
|
Client-cert CA bundle — turns on mTLS verification |
off |
|
Reject clients that present no certificate |
off |
TLS pairing rules are enforced: setting one of cert-file / key-file
without the other is a startup error, and the client-cert flags are only
meaningful with server TLS configured. See Security.
Slow operations¶
An operation that runs for 100 ms or longer writes one line to the log, at
INFO, as mongod does:
[2026-10-09T19:10:59Z INFO secantus_server] Slow query {"type":"command","ns":"bench.stall","command":"insert","ctx":"conn3","ninserted":100,"workingMillis":1717,"durationMillis":1717}
The same lines are in the getLog buffer. workingMillis leaves out time an
awaitData getMore spent waiting for new data, so an idle change stream logs
nothing. A failed operation carries "ok":0 with errCode and errName.
The threshold is the profile command’s slowms, and sampleRate thins the
lines. Both are server-wide and last until the server stops:
client.admin.command("profile", 0, slowms=20) # log anything over 20 ms
The line says which operation was slow and for how long. It does not say where
in the storage engine the time went, which mongod’s line does.
Configuration file¶
Both MongoDB-wire daemons (secantusd-py and secantusd-rs) read the same
secantusd.toml, discovered in order:
./secantusd.toml(per-checkout / per-cwd)~/.secantus/secantusd.toml(per-user)/etc/secantus/secantusd.toml(system-wide)
or passed explicitly with --config. Every key is optional; explicit CLI
flags override the file. The sections mirror the flags (a handful of keys
are Rust-daemon-only — the commented [storage] modes below — and the
Python daemon rejects them, so keep them out of a secantusd.toml shared
with secantusd-py):
[server]
host = "127.0.0.1"
port = 27017
storage_path = "./secantus-data"
log_level = "INFO"
auth = false
standalone = false
[oplog]
retention_seconds = 3600.0
max_entries = 100000
noop_heartbeat_seconds = 0.0
# archive_dir = "/var/lib/secantus/pitr-archive"
[storage]
cache_size = "1G"
session_max = 1000
sync_on_commit = false
# Rust-daemon-only storage modes (secantusd-py rejects these keys):
# oplog_async = true
# oplog_nonlogged = true
# data_nonlogged = true
# checkpoint_seconds = 60
# [tls]
# cert_file = "/etc/letsencrypt/live/db.example.com/fullchain.pem"
# key_file = "/etc/letsencrypt/live/db.example.com/privkey.pem"
# ca_file = "/etc/ssl/client-ca.crt"
# require_client_cert = false
The annotated example ships as secantusd.toml.example in the repository
root. (The legacy secantusdb.toml filename is still auto-discovered at
each location.)
Topology persona¶
By default the server advertises itself in hello as the primary of a
single-node secantus replica set — a deliberate fiction that makes
drivers’ topology machinery accept change streams. There are no other
members and no elections. --standalone switches to a plain standalone
hello for tests and drivers that behave differently against replica
sets (the Java driver’s getSecondary() helper, for example, spins
forever against a replica-set persona with no secondary).