Performance Tuning Parameters
This section details the parameters available for tuning the performance of the Fusion File Share Server. While some parameters have a direct and predictable effect on system performance, others may require trial and error to yield optimal results. Additionally, certain parameters may affect system stability, client application's behavior, or other operational aspects. Therefore, modifications to these settings in production environments should only be made with careful consideration and prior testing.
System Resources
This topic covers parameters related to system resources, such as the number of open files, concurrent network connections, and active threads in the Fusion File Share Server 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 supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
Value Type: integer
Value Format: <connections>
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 unlimited number of connections, limited only by available system resources.
Default Value: 1024
connections_max
together with open_files_max
control the maximum number of open file descriptors Fusion File Share Server can consume. It's essential to keep the combined total of these two parameters within the system's limit. Incorrect configuration may cause the server process to crash.
Maximum Number of Sessions
You can set the maximum number of sessions by setting the sessions_max
parameter:
- Configuration file's
[global]
section:sessions_max
tsmb-cfg global update
:--sessions-max
tsmb-cfg global add
andtsmb-cfg global del
: Not supported
Value Type:: integer
Value Format: <sessions>
The maximum number of client sessions that can be active on the server at any given time. 0
indicates an unlimited number of sessions.
Default Value: 0
.
Multichannel
Fusion File Share Server supports multichannel connections for client sessions. For more information refer to the Multichannel topic.
File Descriptors
The following parameters relate to the file descriptors consumed by Fusion File Share Server.
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 supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
Value Type:: integer
Value Format: <files>
The number of files that can be kept open simultaniously by the server, for all client sessions. 1024
is the minimum value. 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 and potentially trigger the Out of Memory (OOM) killer.
connections_max
together with open_files_max
together control the maximum number of open file descriptors that the Fusion File Share Server can consume. It's crucial to keep the sum of these parameters below the system's limit, as incorrect configuration may crash the server process.
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 supportedtsmb-cfg global add
andtsmb-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, capped by the open-files-max
parameter.
Default Value: 1024
The value of sess_open_files_max
must be set to a value that is lower than the value of open_files_max
. Setting it to a higher value will display a warning, and the value will be reverted to the default value of 1024
.
Network Threads
You can set the maximum number of network threads by setting the transport_rx_threads
and transport_tx_threads
parameters:
- Configuration file's
[global]
section:transport_rx_threads
tsmb-cfg global update
: Not supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
Value Type:: integer
Value Format: <threads>
The number of transport threads used for receiving data from clients. 0
indicates that the data from packets will be read in the context of the kernel's io_mux threads.
Default Value: 256
- Configuration file's
[global]
section:transport_tx_threads
tsmb-cfg global update
: Not supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
Value Type:: integer
Value Format: <threads>
The number of transport threads used for sending data to clients.
Default Value: 256
VFS Behavior
The Virtual File System (VFS) layer in Linux manages file access for all applications, including Fusion File Share Server. Tuning the interaction between Fusion File Share Server 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 supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
vfs_metadata_threads
Value Type:: integer
Value Format: <threads>
Determines 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
, data 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 supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
vfs_data_threads
Value Type:: integer
Value Format: <threads>
Sets 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
As a general guideline, vfs_data_threads
should not be left at the default value of 1
; instead it should be set to a higher value based on workload requirements.
It is highly recommended to experiment with vfs_data_threads
and vfs_metadata_threads
to find the optimal configuration for your workload.
Per-Share VFS Thread Pool
It is also possible to configure a dedicated VFS thread pool for individual shares, enabling performance optimization tailored to each share's usage patterns and requirements.
To set a per-share VFS thread pool, use the following parameters in the share configuration:
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 is a technique that enhances data transfer performance by minimizing the number of memory copies and system calls. Fusion File Share Server leverages zero-copy in the following ways:
- Client's write operations: when write operations reach the operating system's network socket buffers, Fusion File Share Server attempts to use zero-copy to transfer the data directly to the file system page cache, minimizing intermediate copies.
- Client's read operations: during read operations, when the data is retrieved from the disk into the file system page cache, Fusion File Share Server uses zero-copy to send the data directly from the cache 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 is highly dependent on the workload and the underlying storage. It is recommended to evaluate and test this setting within the context of your specific workload.
Global Zero-Copy Write Threshold
You can control the minimum size of the data chunk that will be sent using zero-copy by setting the global vfs_zerocopy_write_threshold
parameter:
- Configuration file's
[global]
section:vfs_zerocopy_write_threshold
tsmb-cfg global update
: Not supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
Value Type:: integer
Value Format: <bytes>
Sets the threshold for zero-copy writes. Write operations larger than this value will use zero-copy, while writes equal to or smaller than this value will not. Setting this parameter to 0
disables zero-copy writes.
Default Value: 0
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 File Share Server 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
Depending on the workload, you may want to preallocate space for files on the underlying storage. This can be achieved by forcing Fusion File Share Server to preallocate space for files 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 to specify the file size range for which space should be preallocated.
SMB Behavior
The following parameters can impact the performance of the Fusion File Share Server 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 supportedtsmb-cfg global add
andtsmb-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
To control case insensitivity, set the case_insensitive
parameter, both globally and on a per-share basis:
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 File Share Server operates, file operations are case-sensitive. When enabled, Fusion File Share Server first attempts to rely on the underlying file system's support for case-insensitive file name resolution. If not supported by the file system, Fusion File Share Server will fall back on performing a case-insensitive comparison of the file name against all the files in the directory.
For use cases that require case-insensitive operations, Fusion File Share Server allows you to modify the default behavior. You can configure case sensitivity globally for all shares or override it on a per-share basis to meet specific requirements.
Fusion File Share Server shares are case-sensitive by default, since processing case-insensitive requests can introduce significant overhead, especially on large datasets or complex directory trees.
- Configuration file's
[global]
section:case_insensitive
tsmb-cfg global update
: Not supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
case_insensitive
Value 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 need for frequent network communication. When a client obtains an oplock, the client can perform certain operations on the file locally without immediately notifying the server, minimizing network requests.
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 supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
oplock
Value Type: string
Value Format: <type>
Where <type>
indicates 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 File Share Server server only grants NONE oplock/lease regardless of the value of RequestedOplockLevel.exclusive
: Similar toall
, 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
It is possible to configure the type of opportunistic locks (oplocks) issued by Fusion File Share Server, restricting them to Level 2 (read-only) oplocks for clients, or disabling them entirely.
Setting oplocks to read-only can be useful for read-heavy workloads, enhancing 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 add
andtsmb-cfg global del
: Not supported
Value Type: integer
Value Format: <credits>
Controls the maximum amount of credits the server will advertise to clients.
Default Value: 8092
Message Size Limits
You can control the maximum size of SMB messages advertised to clients by setting 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 supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
Value Type: integer
Value Format: <bytes>
Where <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 supportedtsmb-cfg global add
andtsmb-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 supportedtsmb-cfg global add
andtsmb-cfg global del
: Not supported
Value Type: integer
Value Format: <bytes>
Where <bytes>
will be used to communicate to the client the maximum buffer size that may be used for QUERY, SET, and NOTIFY operations. The maximum value is determined by the SMB dialect in use.
Default Value: