imap_client_buffer

The `imap_client_buffer` directive specifies the size of the buffer for IMAP client connections in NGINX Mail.

Syntaximap_client_buffer size;
Defaultnone
Contextmail, mail server
Arguments1

Description

The imap_client_buffer directive in the NGINX Mail module allows you to set the size of the buffer allocated for each IMAP client connection. This buffer is used to hold data received from the client before processing it. By specifying a larger buffer, you can accommodate clients that send larger commands or responses, which can improve performance by reducing the need for multiple read operations.

The directive accepts a single argument specifying the buffer size, which can be defined in bytes or with suffixes like k for kilobytes and m for megabytes. When tuning this directive, it's vital to balance memory usage with performance requirements, especially on servers that handle many simultaneous IMAP connections. An adequately sized buffer can help prevent slowdowns caused by frequent memory allocations during high traffic periods.

This directive should be used within the mail or mail server contexts, ensuring it is appropriately applied to the desired mail service configuration. If not set, it could lead to inefficiencies, particularly in environments where multiple IMAP clients interact actively with the server.

Config Example

mail {
    imap_client_buffer 512k;
}

Using a buffer that is too small may lead to increased latency as the server has to read data multiple times from the socket.

Excessively large buffers may waste memory, particularly if many simultaneous connections are present and not all require such capacity.

← Back to all directives