Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Limits and timeouts

All limits and timeouts are configured on SmbServer::builder().

Limits

OptionDefaultPast the limit
max_connections1024Connection closed
max_sessions_per_connection64STATUS_INSUFFICIENT_RESOURCES
max_trees_per_session128STATUS_INSUFFICIENT_RESOURCES
max_opens_per_connection16384STATUS_INSUFFICIENT_RESOURCES
max_locks_per_open1024STATUS_INSUFFICIENT_RESOURCES
max_disconnected_opens4096See durable handles

max_read_size and max_write_size set the largest allowed READ and WRITE sizes. The default is 1 MiB, with a range of 64 KiB to 8 MiB.

ConfigHandle::set_max_opens_per_connection updates the open-handle limit at runtime.

Timeouts

OptionDefaultEffect
handshake_timeout30 sCloses a connection that has not established a session
idle_timeout15 minCloses a connection with no requests and no open files
io_timeout60 sCloses a connection that stalls while sending a request or reading a response
tcp_keepalive60 sIdle time before sending TCP keepalive probes. None disables keepalive
durable_handle_timeout2 minSee durable handles

Logon throttle

logon_throttle(max_failures, lockout) defaults to 10 failures and a 60 s lockout.

ScopeLocked out afterResult
Single usernamemax_failures failures, each within lockout of the previous oneSTATUS_ACCOUNT_LOCKED_OUT until lockout elapses
Single client address10 x max_failures failures across any usernamesSTATUS_ACCOUNT_LOCKED_OUT until lockout elapses
Single connectionmax_failures failuresConnection closed
  • Unknown usernames count the same as configured ones.
  • Setting max_failures to 0 disables the throttle.