# ============================================================================= # settings.conf - every tunable value for the mail server kit, in one place # ============================================================================= # Both start-mail.sh and test-mail.sh read this file. # Edit a value here, then re-run ./start-mail.sh so the servers pick it up. # # Any value can also be overridden for a single run from the command line: # DURATION=30 CLIENTS=100 ./test-mail.sh smtp # ============================================================================= # ----------------------------------------------------------------------------- # 1. Where the mail server is reached # ----------------------------------------------------------------------------- # All test traffic stays on this machine (loopback). No traffic leaves the host. # These are the standard ports; SELinux already allows Postfix and Dovecot to # use them. If another mail server already uses them, start-mail.sh stops # with a message. MAIL_HOST="${MAIL_HOST:-127.0.0.1}" SMTP_PORT="${SMTP_PORT:-25}" # Postfix: receives mail (SMTP) IMAP_PORT="${IMAP_PORT:-143}" # Dovecot: users read mail (IMAP) POP3_PORT="${POP3_PORT:-110}" # Dovecot: users download mail (POP3) # The mail domain of the test users (user1@perf.test ...). The ".test" # top-level domain is reserved for testing (RFC 6761), so it can never clash # with a real domain. MAIL_DOMAIN="${MAIL_DOMAIN:-perf.test}" # ----------------------------------------------------------------------------- # 2. The test instances of Postfix and Dovecot # ----------------------------------------------------------------------------- # A mail server on RHEL 9 = two programs working together: # Postfix (package postfix) receives mail over SMTP, keeps it in its queue # and hands it over for delivery. # Dovecot (package dovecot) stores mail in the users' mailboxes (it # receives it from Postfix over LMTP), checks passwords, and lets # users read their mail over IMAP and POP3. # # The kit runs its OWN copy ("instance") of each, with its own configuration, # queue, mailboxes and logs. Every path below ends in "-perftest", so a mail # server that may already be configured on this host is never touched. # "./start-mail.sh cleanup" removes all of it again. POSTFIX_SERVICE="postfix-perftest" # systemd service name POSTFIX_CONFIG_DIR="/etc/postfix-perftest" # main.cf, master.cf, recipient list POSTFIX_QUEUE_DIR="/var/spool/postfix-perftest" # the mail queue POSTFIX_DATA_DIR="/var/lib/postfix-perftest" # Postfix's own data files POSTFIX_LOG_DIR="/var/log/postfix-perftest" # Postfix log: maillog DOVECOT_SERVICE="dovecot-perftest" # systemd service name DOVECOT_CONFIG_DIR="/etc/dovecot-perftest" # dovecot.conf and the users file DOVECOT_CONFIG="$DOVECOT_CONFIG_DIR/dovecot.conf" DOVECOT_USERS_FILE="$DOVECOT_CONFIG_DIR/users" # test users and password hashes DOVECOT_RUN_DIR="/run/dovecot-perftest" # sockets and PID file DOVECOT_LOG_DIR="/var/log/dovecot-perftest" # Dovecot log: dovecot.log # The mailboxes. Every test user has the folder //Maildir. MAIL_STORE="/var/spool/mail-perftest" # All mailboxes belong to this system account (the usual "virtual users" # set-up: the mail users are not Linux users and cannot log in to the host). MAIL_OWNER="mailperf" # The socket through which Postfix hands messages to Dovecot (LMTP). # It must be inside Postfix's "private" queue folder. LMTP_SOCKET="$POSTFIX_QUEUE_DIR/private/dovecot-lmtp" # ----------------------------------------------------------------------------- # 3. Test data # ----------------------------------------------------------------------------- # Mail users user1 ... userN (addresses user1@perf.test ...). USER_COUNT="${USER_COUNT:-1000}" # Messages put into every mailbox by start-mail.sh, so the IMAP and POP3 # tests have mail to read (1,000 users x 100 = 100,000 messages). MAILBOX_MESSAGES="${MAILBOX_MESSAGES:-100}" # Size of a normal test message, in KB (plain text; the "size" test also # uses bigger ones). MESSAGE_SIZE_KB="${MESSAGE_SIZE_KB:-5}" # Password of every test user. Test-only data, never use a real password here. USER_PASSWORD="${USER_PASSWORD:-Perf-Mail-Pass-1}" # How user passwords are stored (hashed). SHA512-CRYPT is Dovecot's usual # choice on RHEL 9 (5,000 rounds of SHA-512). It decides the speed of the # "auth" test. Other choices: SSHA512 (fast), PBKDF2, PLAIN (test only!). PASSWORD_SCHEME="${PASSWORD_SCHEME:-SHA512-CRYPT}" # ----------------------------------------------------------------------------- # 4. Server settings # ----------------------------------------------------------------------------- # Postfix: the most processes of one kind, e.g. SMTP sessions at once # (default_process_limit). A client beyond this waits until one is free. SMTPD_PROCESS_LIMIT="${SMTPD_PROCESS_LIMIT:-100}" # Postfix: how many messages it hands to Dovecot in parallel # (lmtp_destination_concurrency_limit). LMTP_CONCURRENCY="${LMTP_CONCURRENCY:-20}" # Dovecot: how it starts its processes. # high-security a new, isolated login process for every connection, and # imap/pop3 processes only when needed (Dovecot's default) # high-performance a few long-running login processes serve all # connections, and spare imap/pop3 processes wait ready # (faster logins; see "auth" in PERFORMANCE-METRICS.md) DOVECOT_LOGIN_MODE="${DOVECOT_LOGIN_MODE:-high-security}" # Dovecot: the most IMAP sessions open at once. Every open IMAP session is # one "imap" process, so this is also a limit on processes. IMAP_PROCESS_LIMIT="${IMAP_PROCESS_LIMIT:-2000}" # Dovecot: when to force mailbox writes to disk (mail_fsync). # optimized when it matters for safety (default) # always after every write (safest, slowest) # never never (fastest; mail may be lost in a power failure) MAIL_FSYNC="${MAIL_FSYNC:-optimized}" # ----------------------------------------------------------------------------- # 5. How hard and how long each test runs # ----------------------------------------------------------------------------- DURATION="${DURATION:-10}" # seconds of load for each test run # Simultaneous clients = open connections. Each client does one thing at a # time: it sends one message (or command), waits for the answer, then the next. CLIENTS="${CLIENTS:-50}" CLIENT_LEVELS="${CLIENT_LEVELS:-1 10 50 100 200}" # "concurrency" test steps LATENCY_TEST_RATE="${LATENCY_TEST_RATE:-200}" # "latency": steady messages/s (normal load) MESSAGE_SIZES_KB="${MESSAGE_SIZES_KB:-1 10 100 1024}" # "size": message sizes to compare SIZE_TEST_MB="${SIZE_TEST_MB:-200}" # "size": MB of mail sent per size DELIVERY_TEST_MESSAGES="${DELIVERY_TEST_MESSAGES:-10000}" # "delivery": messages sent and tracked QUEUE_TEST_MESSAGES="${QUEUE_TEST_MESSAGES:-10000}" # "queue": messages waiting in the queue CONNECTION_TEST_COUNT="${CONNECTION_TEST_COUNT:-1000}" # "connections": IMAP sessions open at once CONNECTION_TEST_RATE="${CONNECTION_TEST_RATE:-500}" # "connections": commands/s spread over them STARTUP_ROUNDS="${STARTUP_ROUNDS:-3}" # restarts measured by the "startup" test OPERATION_TIMEOUT="${OPERATION_TIMEOUT:-15}" # seconds without an answer = operation lost QUEUE_WAIT_TIMEOUT="${QUEUE_WAIT_TIMEOUT:-600}" # most seconds to wait for the queue to empty # Worker processes of the load generator (lib/mailload.py). Each one uses up # to one CPU core. Default: a quarter of the CPU cores (1 to 8), so the mail # server keeps most of the CPUs. DEFAULT_LOAD_PROCESSES=$(( $(nproc) / 4 )) (( DEFAULT_LOAD_PROCESSES < 1 )) && DEFAULT_LOAD_PROCESSES=1 (( DEFAULT_LOAD_PROCESSES > 8 )) && DEFAULT_LOAD_PROCESSES=8 LOAD_PROCESSES="${LOAD_PROCESSES:-$DEFAULT_LOAD_PROCESSES}" # ----------------------------------------------------------------------------- # 6. Pass / fail targets # ----------------------------------------------------------------------------- # Sensible starting points for a small RHEL 9 mail server with 1,000 users, # tested over localhost. Adjust them to your own hardware and service # requirements. A result that misses its target is reported as FAIL; # see PERFORMANCE-METRICS.md for what each number means. TARGET_STARTUP_MAX_MS="${TARGET_STARTUP_MAX_MS:-5000}" # start until mail is accepted and readable TARGET_SMTP_MIN_MPS="${TARGET_SMTP_MIN_MPS:-200}" # messages accepted/s, at least TARGET_LATENCY_P95_MAX_MS="${TARGET_LATENCY_P95_MAX_MS:-100}" # 95% of SMTP sessions faster than TARGET_LATENCY_P99_MAX_MS="${TARGET_LATENCY_P99_MAX_MS:-250}" # 99% of SMTP sessions faster than TARGET_SCALING_MIN_PCT="${TARGET_SCALING_MIN_PCT:-50}" # throughput kept at top level vs peak TARGET_SIZE_MIN_MBPS="${TARGET_SIZE_MIN_MBPS:-20}" # MB/s accepted with the largest messages TARGET_DELIVERY_MIN_MPS="${TARGET_DELIVERY_MIN_MPS:-200}" # messages in mailboxes/s, end to end TARGET_DELIVERY_P95_MAX_MS="${TARGET_DELIVERY_P95_MAX_MS:-2000}" # 95% in the mailbox within TARGET_QUEUE_MIN_MPS="${TARGET_QUEUE_MIN_MPS:-200}" # waiting queue delivered/s TARGET_LOGIN_MIN_OPS="${TARGET_LOGIN_MIN_OPS:-100}" # IMAP logins/s, new connection each TARGET_IMAP_MIN_OPS="${TARGET_IMAP_MIN_OPS:-1000}" # messages read over IMAP per s TARGET_POP3_MIN_OPS="${TARGET_POP3_MIN_OPS:-100}" # complete POP3 sessions/s TARGET_ERROR_MAX_PCT="${TARGET_ERROR_MAX_PCT:-0.1}" # failed operations in any load run TARGET_CPU_MAX_PCT="${TARGET_CPU_MAX_PCT:-90}" # share of all CPUs the mail server may use TARGET_MEMORY_MAX_MB="${TARGET_MEMORY_MAX_MB:-2048}" # peak memory of all mail server processes