memcached_send_timeout

Sets the timeout for sending requests to a memcached server.

Syntaxmemcached_send_timeout time;
Default60s
Contexthttp, server, location
Arguments1

Description

The memcached_send_timeout directive specifies the timeout for sending requests to a memcached server in an NGINX configuration. It is defined to manage the maximum time allowed for the NGINX server to wait when sending data to a memcached server before closing the connection. This timeout is crucial for avoiding indefinite waits in cases where network issues or unresponsive servers exist, thus providing a way to ensure that requests are promptly retried or terminated.

The directive takes a single argument set in seconds or in a time format such as m for minutes, h for hours, etc. When the specified timeout is reached, NGINX will close the connection to the memcached server. This is particularly useful in high-load scenarios where response times can vary, and connections should not be held open unnecessarily, which could lead to resource exhaustion.

memcached_send_timeout can be used within the http, server, or location contexts, allowing for flexible configuration at different levels of the server architecture. Setting an appropriate timeout helps maintain optimal performance and responsiveness for applications relying on memcached for caching data.

Config Example

memcached_send_timeout 30s;

Setting this value too low may lead to frequent premature timeouts during normal operation, especially under high load.

Be aware that this timeout only applies to sending requests; it does not affect receiving responses from the memcached server.

← Back to all directives