congestion.config file (by default, located in
/usr/local/etc/trafficserver/) enables you to configure Traffic Server
to stop forwarding HTTP requests to origin servers when they become
congested, and then send the client a message to retry the congested
origin server later. After you modify the
navigate to the Traffic Server bin directory; then run the
traffic_ctl config reload command to apply changes. When you apply the changes
to a node in a cluster, Traffic Server automatically applies the changes
to all other nodes in the cluster. Traffic Server uses the
congestion.config file only if you enable the
You can create rules in the congestion.config file to specify:
- Which origin servers Traffic Server tracks for congestion.
- The timeouts Traffic Server uses, depending on whether a server is congested.
- The page Traffic Server sends to the client when a server becomes congested.
- If Traffic Server tracks the origin servers per IP address or per hostname.
Each line in
congestion.config must follow the format below. Traffic
Server applies the rules in the order listed, starting at the top of the
file. Traffic Server recognizes three space-delimited tags:
primary_destination=value secondary_specifier=value action=value
The following list shows possible primary destinations with allowed values.
- A requested domain name.
- A requested hostname.
- A requested IP address.
- A regular expression (regex) to be found in a URL.
The secondary specifiers are optional in the congestion.config file. The following list shows possible secondary specifiers with allowed values. You can use more than one secondary specifier in a rule; however, you cannot repeat a secondary specifier.
- A requested URL port or range of ports.
- A prefix in the path part of a URL.
The following list shows the possible tags and their allowed values.
5The maximum number of connection failures allowed within the fail window described below before Traffic Server marks the origin server as congested.
120seconds. The time period during which the maximum number of connection failures can occur before Traffic Server marks the origin server as congested.
10seconds. The number of seconds that Traffic Server waits before contacting a congested origin server again.
300seconds. The number of seconds that the client is advised to wait before retrying the congested origin server.
30seconds The upper limit for a random number that is added to the wait interval.
60seconds. The connection timeout to the live (uncongested) origin server. If a client stops a request before the timeout occurs, then Traffic Server does not record a connection failure.
2The maximum number of retries allowed to the live (uncongested) origin server.
15seconds. The connection timeout to the congested origin server.
1The maximum number of retries allowed to the congested origin server.
-1The maximum number of connections allowed from Traffic Server to the origin server.
"congestion#retryAfter"The error page sent to the client when a server is congested. You must enclose the value in quotes;
"per_ip"Specifies if Traffic Server applies the rule on a per-host (
"per_host") or per-IP basis (
"per_ip"). You must enclose the value in quotes.
For example: if the server
www.host1.comhas two IP addresses and you use the tag value
"per_ip", then each IP address has its own number of connection failures and is marked as congested independently. If you use the tag value
"per_host"and the server
www.host1.comis marked as congested, then both IP addresses are marked as congested.
congestion.config rule configures Traffic Server to
stop forwarding requests to the server
www.host.com on port 80 (HTTP
traffic) if the server is congested, according to the timeouts
specified. Traffic Server uses the default tag values because no tag has
You can use one or more tags in a rule, but each tag must have one value only. If you specify no tags in the rule, then Traffic Server uses the default values.
You can override any of the default tag values by adding configuration
variables at the end of
records.config as follows:
CONFIG proxy.config.http.congestion_control.default.tag INT|STRING value
where tag is one of the tags described in the list under
congestion.config and value is the value you
want to use.
CONFIG proxy.config.http.congestion_control.default.congestion_scheme STRING per_host
proxy.config.http.connect_attempts_max_retries proxy.config.http.connect_attempts_max_retries_dead_server proxy.config.http.connect_attempts_rr_retries proxy.config.http.connect_attempts_timeout proxy.config.http.down_server.cache_time proxy.config.http.down_server.abort_threshold