store_http_read_retries
The `store_http_read_retries` directive defines the number of retries for reading HTTP responses when a request is being processed.
Description
The store_http_read_retries directive is part of the Kaltura Media Framework implementation within NGINX and controls the number of attempts the server will make to read from a backend server when processing incoming requests. This is particularly useful in scenarios where network connectivity is unreliable, or where the backend service may intermittently fail to respond correctly. By configuring this directive, administrators can set a custom retry strategy to improve the resilience of the media streaming service against such transient errors.
When this directive is set, each read operation from the backend server that fails will trigger a retry up to the specified number of attempts. The directive accepts a single argument, which is an integer value indicating the maximum number of retries before the request is ultimately failed. This can be essential in media streaming applications where maintaining a seamless user experience is critical, and temporary backend errors should not lead to immediate failures of the streaming service.
It is important to note that configuring too high a retry count may lead to increased latency for clients while the server waits for a successful response, whereas too low could result in failed requests during brief backend unavailability. Therefore, careful consideration is necessary when setting this value to balance reliability with performance.
Config Example
server {
listen 80;
location /api {
store_http_read_retries 3;
}
}Setting a high number of retries can significantly increase latency for user requests.
If the backend service is consistently unresponsive, this setting may lead to prolonged request handling times before failing requests.
The directive only applies to HTTP read operations and does not influence the connection setup phase.