Skip to main content

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:

Global Parameter Maximum Number of Client Connections

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

important

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:

Global Parameter Configuring the Maximum Number of Sessions

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:

Global Parameter Maximum Number of Open Files

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

warning

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.

important

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:

Global Parameter Maximum Number of Open Files per Session

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

important

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:

Global Parameter Number of Receive Threads

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

Global Parameter Number of Transmit Threads

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:

Global Parameter Number of Metadata Threads
Potentially Overridden by Share Parameter: 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

Global Parameter Number of Data Threads
Potentially Overridden by Share Parameter: 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

important

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:

Share Parameter Number of Data Threads
Potentially Overrides Global Parameter: vfs_data_threads

Value Type: integer

Value Format: <threads>
Determines the number of threads for VFS data operations in the share's pool. If set to 0:

  • If the share's vfs_metadata_threads is not set to 0, VFS operations will be executed on the share's data thread pool.
  • If the share's vfs_metadata_threads is also set to 0, VFS operations will be executed on the global pool, as specified in the global vfs_data_threads parameter.

Default Value: 1

Share Parameter Number of Metadata Threads
Potentially Overrides Global Parameter: vfs_metadata_threads

Value Type: integer

Value Format: <threads>
Determines the number of threads for VFS metadata operations in the share's pool. If set to 0:

  • If the share's vfs_data_threads is not set to 0, VFS operations will be executed on the share's data thread pool.
  • If the share's vfs_data_threads is also set to 0, VFS operations will be executed on the global pool, as specified in the global vfs_metadata_threads parameter.

Default Value: 1

important

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.
important

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:

Global Parameter Global Zero-Copy Write Threshold

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:

Share Parameter Toggling Zero-Copy for Read Operations

Value Type: boolean

Value Format: true|false

  • true: Enables zero-copy for read operations on the share.
  • false: Disables zero-copy for read operations on the share.

Default Value: false

Share Parameter Toggling Zero-Copy for Write Operations

Value Type: boolean

Value Format: true|false

  • true: Enables zero-copy for write operations on the share.
  • false: Disables zero-copy for write operations on the share.

Default Value: true

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:

Share Parameter Toggling Synchronous I/O and Forced Buffering

Value Type: string

Value Format: <type>:<option>[,<option>,...]

  • <type> specifies the type of the VFS module to use. Currently, the only supported option is:
    • libc: the default VFS module for Linux.
  • <option> can be set to one of the following:
    • force_sync: opens each file with the O_SYNC flag to ensure that all data is written to disk before returning from a write operation. This option is useful for applications requiring strong durability guarantees, but it degrades performance. This option is required for clusters in active-passive mode.
    • nodirect: ignores client requests for direct I/O, bypassing the OS's page cache. This applies to FILE_NO_IMMEDIATE_BUFFERING on Windows, O_DIRECT on Linux, and F_NOCACHE on macOS. This option is likely to improve performance, but could disregard the client application's expectations, potentially resulting in undefined behavior. Use with caution.
    • lock: enables the propagation of byte-range locks to the underlying file system,allowing interoperability with other applications (such as NFS servers) that depend on byte-range locks. Note that this option may degrade performance.

Default Value: none (libc is configured to not use O_SYNC and to respect client's requests for direct I/O).

Examples:

  • libc:force_sync,nodirect will force Fusion File Share Server to open all files with the O_SYNC flag, and to ignore client's requests for direct I/O.

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.

Share Parameter Minimum Size of Preallocated Space

Value Type: integer

Value Format: <bytes>
Where <bytes> is the minimum size of a file that will be allocated using fallocate.

Default Value: 0

Share Parameter Maximum Size of Preallocated Space

Value Type: integer

Value Format: <bytes>
Where <bytes> is the maximum size of a file that will be allocated using fallocate.

Default Value: 0

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:

Global Parameter Maximum Number of Shares

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.

important

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.

Global Parameter Setting Case Insensitivity Globally
Overridden by Per-Share Parameter: 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

Share Parameter Setting Case Insensitivity on a Per-Share Basis
Overrides Global Parameter: case_insensitive

Value Type: boolean

Value Format: true|false

  • true: Makes file operations on the share case-insensitive.
  • false: Leaves file operations on the share case-sensitive.

Default Value: as set in the global configuration.

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:

Global Parameter Global Oplock Behavior
Potentially Overridden by Share Parameter: 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 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

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.

Share Parameter Controlling the Type of Oplocks Issued for a Share
Potentially Overrides Global Parameter: oplock
Ignored when global parameter oplock is set to disabled

Value Type: string

Value Format: <type>
Where <type> indicates the type of opportunistic lock to be issued:

  • 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.
  • read: Read-only oplock/lease support. This may be used to increase performance when the workload mostly consists of read operations.
  • all: Full oplock/lease support.

Default Value: all

SMB2 Credits

To control the number of credits that are issued to clients, set the smb2_credits_max parameter:

Global Parameter Number of SMB2 Credits

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:

Global Parameter Maximum Size of SMB Messages for Read Operations

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:

  • 65536 for dialect 2.002 and lower
  • 8388608 for dialect 2.1 and higher
Global Parameter Maximum Size of SMB Messages for Write Operations

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:

  • 65536 for dialect 2.002 and lower
  • 8388608 for dialect 2.1 and higher
Global Parameter Maximum Size of SMB Messages for Transact Operations

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:

  • 65536 for dialect 2.002 and lower
  • 8388608 for dialect 2.1 and higher