Performance Tuning Parameters
This section outlines the parameters available for tuning the performance of Fusion SMB. While some parameters have a direct and predictable impact on system performance, others may require experimentation to achieve best results. Additionally, certain parameters may affect system stability, client application's behavior, or other operational aspects. Therefore, any modifications to these settings in production environments should only be made with careful consideration and after thorough testing.
Windows 11 24H2 was officially released on October 1, 2024 and requires signing by default. This may negatively impact performance which is expected and is not Fusion SMB specific behavior. If you need performance over security, simply disable SMB signing requirement on Windows clients. Please see: https://learn.microsoft.com/en-us/windows-server/storage/file-server/smb-signing?tabs=group-policy#disable-smb-signing
System Resources
This section covers parameters related to system resources, such as the number of open files, concurrent network connections, and active threads in the Fusion SMB process, all of which impact RAM usage.
Network Connections
Maximum Number of Client Connections
To increase or decrease the maximum number of client connections, set the connections_max parameter:
- Configuration file's [global]section:connections_max
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <connections>
<connections> specifies the maximum number of concurrent client connections allowed to the server. Once the limit is reached, new connections will be rejected. A value of 0 allows for an unlimited number of connections, constrained only by the available system resources.
Default Value: 1024
The connections_max parameter in conjunction with the open_files_max parameter, controls the maximum number of open file descriptors Fusion SMB can consume. It is critical to keep the combined total of these two parameters within the system's limit. Misconfiguration may result in the server process crashing.
Maximum Number of Sessions
To configure the maximum number of client sessions, use the sessions_max parameter:
- Configuration file's [global]section:sessions_max
- tsmb-cfg global update:- --sessions-max
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <sessions>
<sessions> specifies the maximum number of client sessions that can be active on the server at any given time. A value of 0 indicates an unlimited number of sessions.
Default Value: 0.
Multichannel
Fusion SMB supports multichannel connections for client sessions. For more information see Multichannel.
File Descriptors
The following parameters control the number of file descriptors consumed by Fusion SMB.
If clients encounter errors when attempting to open files (e.g., STATUS_TOO_MANY_OPENED_FILES on Windows, or ENFILE or EMFILE on Linux/macOS), consider increasing the values of these parameters for raising the system's limit on open files.
Maximum Number of Open Files
To set the maximum number of open files, adjust the open_files_max parameter:
- Configuration file's [global]section:open_files_max
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <files>
<files> specifies the number of files that can be kept open simultaneously by the server across all client sessions. The minimum value is 1024. A value of 0 indicates that the server will use the system's default value (i.e., the value in /proc/sys/fs/nr_open).
Default Value: 8192
Setting this parameter to a high value on devices with limited RAM may cause significant memory fragmentation, potentially triggering the Out of Memory (OOM) killer.
The connections_max parameter in conjunction with the open_files_max parameter, controls the maximum number of open file descriptors that Fusion SMB can consume. It is critical to keep the sum of these parameters below the system's limit. Misconfiguration may result in the server process crashing.
Maximum Number of Open Files per Session
To set the maximum number of open files per session, adjust the sess_open_files_max parameter:
- Configuration file's [global]section:sess_open_files_max
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <sessions>
The maximum number of open files per session. 0 indicates that the maximum number of open files is unlimited.
Default Value: 1024
The sess_open_files_max parameter must be set to a value lower than the value of open-files-max. If it is set to a higher value, a warning will be displayed, and the parameter will automatically revert to its default value of 1024.
Network Threads
To set the maximum number of network threads, use the transport_rx_threads and transport_tx_threads parameters:
- Configuration file's [global]section:transport_rx_threads
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <threads>
<threads> specifies the number of transport threads used for receiving data from clients. A value of 0 indicates that the data from packets will be read in the context of the kernel's io_mux threads.
Default Value: 0
- Configuration file's [global]section:transport_tx_threads
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <threads>
<threads> specifies the number of transport threads used for sending data to clients.
Default Value: 1
VFS Behavior
The Virtual File System (VFS) layer in Linux manages file access for all applications, including Fusion SMB. Tuning the interaction between Fusion SMB and VFS can greatly enhance system performance.
VFS Data and Metadata Threads
Global VFS Thread Pool
The global VFS thread pool controls the number of threads used to handle data and metadata operations for shares without a dedicated VFS thread pool.
To set the global VFS thread pool, adjust the vfs_data_threads and vfs_metadata_threads parameters:
- Configuration file's [global]section:vfs_metadata_threads
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
vfs_metadata_threadsValue Type: integer
Value Format: <threads>
<threads> specifies the number of threads for VFS metadata operations in the global pool (i.e., shared between all shares without a dedicated pool). If set to 0, metadata operations will share the same thread pool as data operations, as specified in the vfs_data_threads parameter.
Default Value: 1
- Configuration file's [global]section:vfs_data_threads
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
vfs_data_threadsValue Type: integer
Value Format: <threads>
<threads> specifies the number of threads for VFS data operations in the global pool (shared across all shares without a dedicated pool). If set to 0, data operations will use the same thread pool as metadata operations, as specified by the vfs_metadata_threads parameter.
Default Value: 1
It is strongly recommended not to leave vfs_data_threads at the default value of 1. Adjust it to a higher value based on workload requirements.
Additionally, experimentation is advised to determine the optimal values for vfs_data_threads and vfs_metadata_threads for your workload.
Per-Share VFS Thread Pool
To optimize performance based on each share's specific usage patterns and requirements, you can configure a dedicated VFS thread pool for individual shares:
As with the global VFS thread pool, if a specific share requires a dedicated VFS thread pool, experiment with the number of threads to determine the optimal configuration for your workload.
Zero-Copy
Zero-copy enhances data transfer performance by minimizing the number of memory copies and system calls. Fusion SMB leverages zero-copy on client read operations by retrieving data from the file system page cache and uses zero-copy to send it directly to the network socket buffer.
Regardless of the setting, zero-copy is disabled for all SMB messages that are compound, signed, or encrypted.
The impact of zero-copy on performance varies depending on the workload and underlying storage. It is recommended to evaluate and test this setting within the context of your specific workload.
Toggling Per-Share Zero-Copy Behavior
To control the zero-copy behavior on a per-share basis by setting the vfs_zerocopy_write and vfs_zerocopy_read parameters in the share configuration:
Synchronous I/O and Forced Buffering
To force Fusion SMB to perform synchronous I/O, or to force buffering of write operations into the page cache, regardless of the client's request, adjust the vfs parameter on a per-share basis:
File Space Preallocation
For workloads that benefit from preallocated file space, you can configure Fusion SMB to preallocate space on the underlying storage using the fallocate() system call.
To enable preallocations on a per-share basis, set the vfs_fallocate_min and vfs_fallocate_max parameters on a share. These parameters define the file size range for which space should be preallocated.
SMB Behavior
The following parameters can impact the performance of Fusion SMB by adjusting its behavior within the context of SMB protocol.
Maximum Number of Shares
To limit the number of shares that can be created, set the shares_max parameter:
- Configuration file's [global]section:shares_max
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <shares>
Specifies the maximum number of shares that can be configured on the server, including both administrative and user shares.
Default Value: 1048576
Case Insensitivity
In Windows environments, file operations are case-insensitive by default, meaning the file system does not differentiate between uppercase and lowercase characters in file or directory names. For example, MyFile.txt is treated the same as myfile.txt.
However, on Linux–where Fusion SMB operates–file operations are inherently case-sensitive. Hence, file operations on Fusion SMB are case-sensitive by default. For use cases that require case-insensitive operations, you can modify this behavior. Case sensitivity can be controlled globally, or overridden on a per-share basis.
When configured to be case-insensitive, Fusion SMB first attempts to rely on the underlying file system's support for case-insensitive file name resolution. However, if not supported by the file system, Fusion SMB will fall back on performing a case-insensitive comparison of the file name against all the files in the directory.
Enabling case-insensitivity can introduce a significant overhead, especially on file systems that don't natively support it, or on large datasets and complex directory trees.
To control case insensitivity, set the case_insensitive parameter, both globally and on a per-share basis:
- Configuration file's [global]section:case_insensitive
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
case_insensitiveValue Type: boolean
Value Format: true|false
- true: Makes file operations case-insensitive by default.
- false: Leaves file operations case-sensitive by default.
Default Value: false
Opportunistic Locking
Opportunistic locks (oplocks) enable a client to cache file data locally, boosting performance by reducing the frequency of message exchanges between the client and server. With an oplock obtained, the client can perform certain operations on the file locally without immediately notifying the server, thereby minimizing network traffic.
If another client attempts to access the same file, the server revokes the oplock, prompting the original client to flush its cached data to the server to maintain data consistency.
Oplocks improve performance in single-client scenarios while ensuring data integrity in multi-client environments.
Global Oplock Behavior
To control the global oplock behavior, set the oplock parameter:
- Configuration file's [global]section:oplock
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
oplockValue Type: string
Value Format: <type>
<type> specifies the type of opportunistic lock to be issued:
- all: Full oplock/lease support.
- disabled: Disables oplock/lease support. This prevents the server from advertising the SMB2_GLOBAL_CAP_LEASING capability to clients.
- none: Enables oplock/lease support and advertises the SMB2_GLOBAL_CAP_LEASING capability to clients. However, Fusion SMB server only grants NONE oplock/lease regardless of the value of RequestedOplockLevel.
- exclusive: Similar to- all, however only one oplock can be granted on a file at a time. Multiple clients can access a file, as long as there are no oplocks on it, or all clients have the same lease key.
Default Value: all
Controlling the Type of Oplocks Issued for a Share
You can configure the type of opportunistic locks (oplocks) issued by Fusion SMB, restricting them to Level 2 (read-only) oplocks, or disabling them entirely.
Restricting oplocks to read-only can be useful for read-heavy workloads, as it improves performance by minimizing the need for oplock revocations.
SMB2 Credits
To control the number of credits that are issued to clients, set the smb2_credits_max parameter:
- Configuration file's [global]section:smb2_credits_max
- tsmb-cfg global update:- --smb2-credits-max
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <credits>
<credits> specifies the maximum amount of credits the server will advertise to clients.
Default Value: 8092
Message Size Limits
To control the maximum size of SMB messages advertised to clients, set the smb2_read_max, smb2_write_max, and smb2_trans_max parameters:
- Configuration file's [global]section:smb2_read_max
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <bytes>
<bytes> specifies the maximum data size the server can return in a single READ operation to the client. The maximum value is determined by the SMB dialect being used.
Default Value:
- Configuration file's [global]section:smb2_write_max
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <bytes>
Where <bytes> will be used to communicate to the client the maximum data size the server will accept in a single WRITE operation. The maximum value is determined by the SMB dialect being used.
Default Value:
- Configuration file's [global]section:smb2_trans_max
- tsmb-cfg global update: Not supported
- tsmb-cfg global addand- tsmb-cfg global del: Not supported
Value Type: integer
Value Format: <bytes>
<bytes> specifies the maximum buffer size that may be used for QUERY, SET, and NOTIFY operations. This value is communicated to the client. The maximum value is determined by the SMB dialect in use.
Default Value: