# ============================================================================= # settings.conf - every tunable value for the Samba kit, in one place # ============================================================================= # Both start-samba.sh and test-samba.sh read this file. # After changing a value in sections 1-3, run ./start-samba.sh again so the # test Samba server and the test mount pick it up. # # Any value can also be overridden for a single run from the command line: # DURATION=30 ./test-samba.sh seqread # ============================================================================= # ----------------------------------------------------------------------------- # 1. The test Samba server (its own smbd instance) # ----------------------------------------------------------------------------- # The kit runs its OWN smbd, with its own configuration file, its own port # and its own database folders. A Samba server that already runs on this # host (smb.service, port 445) is not touched, not restarted, and does not # see the test user. # The test server listens on 127.0.0.1 only, so no other machine can reach # it and no firewall change is needed. # "./start-samba.sh cleanup" removes everything the kit created. SAMBA_ADDRESS="127.0.0.1" # the only address smbd listens on SAMBA_PORT="${SAMBA_PORT:-4450}" # TCP port (the normal SMB port 445 stays free) # The address the test CLIENTS connect to, on the normal SMB port 445. # Samba's client library (Samba 4.21 on RHEL 9.6) and the kernel's SMB # client after a reconnect always use port 445, so the kit forwards # 127.0.0.2:445 -> 127.0.0.1:4450 (the test smbd) # with one nftables rule in a table of its own ("samba_perf_test"). # Only connections to 127.0.0.2 are forwarded; the host's own Samba on # port 445 and its clients are not affected. CONNECT_ADDRESS="127.0.0.2" SHARE_NAME="perftest" # name of the test share: //127.0.0.2/perftest SHARE_DIR="${SHARE_DIR:-/srv/samba-perf-test}" # folder that is shared TEST_USER="smbperf" # local user that logs in (no shell, no home) SERVICE_NAME="smbd-perf-test" # systemd service of the test server UNIT_FILE="/etc/systemd/system/$SERVICE_NAME.service" CONF_DIR="/etc/samba/perf-test" # smb.conf, credentials, kit state TEST_CONF="$CONF_DIR/smb.conf" # the test server's smb.conf CREDENTIALS_FILE="$CONF_DIR/credentials" # test user + password (mode 600) KIT_STATE_FILE="$CONF_DIR/kit.state" # remembers what to undo DATA_BASE_DIR="/var/lib/samba/perf-test" # Samba's databases (*.tdb) of the test server RUN_DIR="/run/samba/perf-test" # PID file and local sockets LOG_DIR="/var/log/samba/perf-test" # the test server's log files # ----------------------------------------------------------------------------- # 2. Samba server settings that change performance # ----------------------------------------------------------------------------- # All four are explained in PERFORMANCE-METRICS.md, section 7. # Encrypt all SMB traffic (SMB3 encryption, AES-GCM)? no | yes # "yes" sets "server smb encrypt = required" and mounts with "seal". ENCRYPTION="${ENCRYPTION:-no}" # Sign every SMB message? default | mandatory # "default" = sign only when the client asks (RHEL default for a file server). SIGNING="${SIGNING:-default}" # Honour the client's "flush to disk" requests? yes (Samba default, safe) | no STRICT_SYNC="${STRICT_SYNC:-yes}" # Send file data with the kernel's sendfile() call? no (RHEL default) | yes USE_SENDFILE="${USE_SENDFILE:-no}" # ----------------------------------------------------------------------------- # 3. The test mount (client side, on this same machine) # ----------------------------------------------------------------------------- # start-samba.sh mounts the test share here with the Linux kernel's SMB # client (cifs.ko, like "mount -t cifs"). fio reads and writes through it, # exactly like a real client machine. MOUNT_POINT="${MOUNT_POINT:-/mnt/samba-perf-test}" SMB_VERSION="${SMB_VERSION:-3.1.1}" # SMB dialect: 3.1.1 (Windows 10+, RHEL 9), 3.0 or 2.1 # ----------------------------------------------------------------------------- # 4. Test data (created on the share by test-samba.sh) # ----------------------------------------------------------------------------- # fio/data.0, data.1, ... : one file of DATA_FILE_MB per sequential stream. # The random-I/O tests all use data.0. DATA_FILE_MB="${DATA_FILE_MB:-1024}" # "yes" = empty the page cache before every read test (sync, then # drop_caches), so reads come from DISK. "no" = reads come from the server's # memory (the files were just written), which measures Samba itself. # The cache is shared by every program on this machine; see section 3 of # PERFORMANCE-METRICS.md before switching it on for a production server. DROP_CACHES="${DROP_CACHES:-no}" # ----------------------------------------------------------------------------- # 5. How hard and how long each test runs # ----------------------------------------------------------------------------- DURATION="${DURATION:-10}" # seconds of load for each test run # "seqwrite", "seqread": parallel streams, 1 MiB blocks, requests in flight per stream. SEQ_STREAMS="${SEQ_STREAMS:-1}" SEQ_QUEUE_DEPTH="${SEQ_QUEUE_DEPTH:-8}" # "randread", "randwrite", "cpu": 4 KiB blocks at random places in data.0. RANDOM_JOBS="${RANDOM_JOBS:-4}" # parallel jobs (like 4 application threads) RANDOM_QUEUE_DEPTH="${RANDOM_QUEUE_DEPTH:-16}" # requests in flight per job # "latency", "errors": a steady, realistic load of LOAD_RATE 4 KiB requests # per second (70% reads, 30% writes), one at a time. LOAD_RATE="${LOAD_RATE:-500}" # "login", "metadata": this many clients work at the same time. WORKERS="${WORKERS:-8}" SMALL_FILE_KB="${SMALL_FILE_KB:-4}" # "metadata": size of each small file # "concurrency": clients reading at the same time, step by step. Every # client has its OWN connection (and so its own smbd process), and waits for # its answer before it sends the next request. CONCURRENCY_LEVELS="${CONCURRENCY_LEVELS:-1 4 16 64 128}" # "memory": client connections held open at the same time while memory is measured. MEMORY_CONNECTIONS="${MEMORY_CONNECTIONS:-200}" STARTUP_ROUNDS="${STARTUP_ROUNDS:-3}" # restarts measured by the "startup" test RECOVERY_TIMEOUT="${RECOVERY_TIMEOUT:-60}" # seconds to wait for the mounted client to work again # ----------------------------------------------------------------------------- # 6. Pass / fail targets # ----------------------------------------------------------------------------- # Sensible starting points for a RHEL 9 file server with local SSD storage # and a 10 Gbit/s network. Adjust them to your own needs. A result that # misses its target is reported as FAIL; see PERFORMANCE-METRICS.md. TARGET_STARTUP_MAX_MS="${TARGET_STARTUP_MAX_MS:-3000}" # start until a login works TARGET_RECOVERY_MAX_S="${TARGET_RECOVERY_MAX_S:-10}" # start until the mounted client works again TARGET_LOGIN_MIN_PER_S="${TARGET_LOGIN_MIN_PER_S:-100}" # new connections (with login) per second TARGET_LOGIN_P95_MAX_MS="${TARGET_LOGIN_P95_MAX_MS:-100}" # 95% of logins faster than TARGET_SEQWRITE_MIN_MBPS="${TARGET_SEQWRITE_MIN_MBPS:-200}" # MB/s, at least TARGET_SEQREAD_MIN_MBPS="${TARGET_SEQREAD_MIN_MBPS:-500}" # MB/s, at least TARGET_RANDREAD_MIN_IOPS="${TARGET_RANDREAD_MIN_IOPS:-10000}" # 4 KiB reads per second TARGET_RANDWRITE_MIN_IOPS="${TARGET_RANDWRITE_MIN_IOPS:-1000}" # 4 KiB writes per second TARGET_LATENCY_P95_MAX_MS="${TARGET_LATENCY_P95_MAX_MS:-5}" # 95% of requests faster than TARGET_LATENCY_P99_MAX_MS="${TARGET_LATENCY_P99_MAX_MS:-10}" # 99% of requests faster than TARGET_ERRORS_MAX_PCT="${TARGET_ERRORS_MAX_PCT:-0}" # failed requests, at most % TARGET_METADATA_MIN_PER_S="${TARGET_METADATA_MIN_PER_S:-500}" # small files created per second TARGET_CONCURRENCY_MIN="${TARGET_CONCURRENCY_MIN:-64}" # clients served with p99 <= target TARGET_CPU_MAX_US_PER_OP="${TARGET_CPU_MAX_US_PER_OP:-100}" # smbd CPU microseconds per 4 KiB read TARGET_MEMORY_MAX_MB_PER_CONN="${TARGET_MEMORY_MAX_MB_PER_CONN:-5}" # server memory (PSS) per client connection