Getting started Community Training Tutorials Documentation APIs, AI & Tools
FLEX_STREAM_IDLE_TIMEOUT_SECONDS: 300 FLEX_UPSTREAM_CONNECTION_IDLE_TIMEOUT_SECONDS/FLEX_CONNECTION_IDLE_TIMEOUT_SECONDS: 60 FLEX_UPSTREAM_RESPONSE_TIMEOUT_SECONDS: 15
Omni Gateway offers these timeouts to improve service quality and reduce computing resource waste:
Stream Idle Timeout
The Stream Idle Timeout enables you to set a maximum amount of a time a stream can remain idle without receiving any data in either the inbound (client to Omni Gateway) or outbound (Omni Gateway to upstream service) direction.
By default, all Omni Gateway API instances have a stream timeout of 300 seconds.
Upstream Idle Timeout
The Upstream Idle Timeout enables you to set a maximum amount of time a stream between Omni Gateway and the upstream service can remain idle between requests.
By default, all Omni Gateway API instances have an upstream idle timeout of 60 seconds.
Response Timeout
The Response Timeout enables you to set a maximum amount of a time Omni Gateway waits for a response from an upstream service. The timeout time starts at the last request sent by Omni Gateway.
By default, all Omni Gateway API instances have a response timeout of 15 seconds.
You can configure these timeouts in Connected Mode via:
Runtime Manager runtime configurations: Applies to all API instances in the gateway.
Environment variables: Applies to all API instances and is the most permanent configuration option.
Configuration YAML resource: Applies to all API instances and is easy to adjust.
Policy: Applies to one API instance or upstream and provides granular control.
When you configure a setting in more than one place, Omni Gateway uses the first value that is set, in this order of precedence:
Policy: A policy applied to the API instance.
Runtime Manager runtime configuration or Configuration resource: Used if no policy value is set.
Environment variable: Used if no Runtime Manager or Configuration resource value is set.
Built-in default: Used if none of the other values is set.
A policy value overrides the gateway-level value for the API instance it’s applied to. API instances without the policy use the gateway-level value.
Runtime Manager runtime configurations and environment variables don’t synchronize. Changing a value in Runtime Manager doesn’t update the corresponding FLEX_* environment variable on the gateway. Because the Runtime Manager value takes precedence, the environment variable has no effect on that setting while the Runtime Manager value is set. For how to verify the effective value, see Environment Variable Synchronization.
In Anypoint Platform, select Runtime Manager.
Select Omni Gateways.
Select your Omni Gateway.
Open Runtime Configurations.
Open Timeouts.
Set values for Stream Idle Timeout, Upstream Connection Idle Timeout, and Upstream Response Timeout.
Apply the changes.
Configure timeouts with these environment variables:
FLEX_STREAM_IDLE_TIMEOUT_SECONDS: 300 FLEX_UPSTREAM_CONNECTION_IDLE_TIMEOUT_SECONDS/FLEX_CONNECTION_IDLE_TIMEOUT_SECONDS: 60 FLEX_UPSTREAM_RESPONSE_TIMEOUT_SECONDS: 15
Edit the variables with your desired configurations.
Edit and then apply this configuration resource to update your timeouts:
apiVersion: gateway.mulesoft.com/v1alpha1
kind: Configuration
metadata:
name: timeouts-config
spec:
timeouts:
upstreamConnectionIdleSeconds: 60
upstreamResponseSeconds: 15
streamIdleSeconds: 300