Module Styx.ServerConfig

ServerConfig defines configuration directives for the 9P servers defined by the Server functor.

type t = {
max_fids : int;

Max number of open files

queue_depth : int;

Max number of outstanding I/O requests

max_message_size : int;

Maximum size of a single I/O request

}

Configuration for a 9P server.

  • max_fids is the maximum number fids (file descriptors) allowed on the connection. The protocol allows for the number of fids to be the maximum value of a 32-bit integer; however, actually using that many fids will have an adverse affect on performance and memory usage, as each fid requires an entry in a lookup table to associate it with a file, user, and I/O mode. A good rule of thumb is to set fids to greater than the maximum number of file descriptors allowed for the users of this file system.
  • queue_depth is the maximum number of Tread and Twrite requests that can be in progress before blocking the submission of further requests. An appropriate value depends on the capabilities of the underlying storage. If the storage has high throughput but high latency, a higher queue depth is necessary to reach the expected levels of throughput.
  • max_message_size is the maximum size, in bytes, of a single 9P message. Together with queue_depth, it determines the size of a server's send and receive buffers. The ideal message size should be a multiple of the underlying hardware or file system's block size. The client may negotiate a smaller message size limit, but not a larger one.
val defaults : t

Default configuration settings. Defaults can be selectively overridden like so:

Styx.ServerConfig.({defaults with
  max_fids = 100;
})