You're viewing Apigee Edge documentation.
Go to the
Apigee X documentation. info
This document explains how to configure the I/O timeout on Apigee Edge’s Routers.
The I/O timeout on the Router represents the time for which the Router waits to receive a response from the Message Processor, after establishing the connection and sending the request to the Message Processor. The default value of the I/O timeout on the Router is 57 seconds.
The I/O timeout for Routers can be increased or decreased from the default value of 57 seconds based on your needs. It can be configured in the following ways:
- In a virtual host
- On the Router
The following properties control the I/O timeout on the Routers:
Property Name | Location | Description |
---|---|---|
proxy_read_timeout
|
Virtual host |
Specifies the maximum time for which the Router waits to receive a response from the Message Processor, after establishing the connection and sending the request to the Message Processor. If there is no response from the Message Processor within this timeout period, then the Router times out. By default, this property takes the value set for the
If this property is modified with a new timeout value for a specific virtual host, then only the API proxies using that specific virtual host are affected. |
conf_load_balancing_load.balancing.driver.proxy.read.timeout
|
Router |
Specifies the maximum time for which the Router waits to receive a response from the Message Processor, after establishing the connection and sending the request to the Message Processor. If there is no response from the Message Processor within this timeout period, then the Router times out. This property is used for all the virtual hosts on this Router. The default value of this property is 57 seconds. You can either modify this property as explained in
Configuring I/O timeout on Routers below, or you can overwrite
this value by setting the You can set the time interval for this property as something other than seconds using the following notation: ms: milliseconds s: seconds (default) m: minutes h: hours d: days w: weeks M: months (length of 30 days) y: years (length of 365 days) |
conf_load_balancing_load.balancing.driver.nginx.upstream_next_timeout
|
Router |
Specifies the total time the Router waits to receive a response from all the Message Processors, after establishing the connection and sending the request to each Message Processor. This is applicable when your Edge installation has multiple Message Processors and retry is enabled upon occurrence of errors. It has the value of one of the following:
As with the |
Before you begin
Before you use the steps in this document, be sure you understand the following topics:
- If you aren’t familiar with virtual host Properties, read Virtual host property reference.
- If you aren’t familiar with configuring properties for Edge on Private Cloud, read How to configure Edge.
- Ensure that you follow the Best practices for configuring I/O timeout recommendations.
Configuring I/O timeout in virtual host
This section explains how to configure I/O timeout in the virtual host associated with an
organization and environment. The I/O timeout can be configured in the virtual host through the
property proxy_read_timeout
, which represents the I/O timeout value in seconds.
You can configure the virtual host using one of the following methods:
- Edge UI
- Edge API
Edge UI
To configure the virtual host using the Edge UI, do the following:
- Login to Edge UI.
- Navigate to Admin > Virtual Hosts.
- Select a specific Environment where you want to make this change.
- Select the specific virtual host for which you would like to configure the new I/O timeout value.
- Under Properties, update the Proxy Read Timeout value in seconds.
For example, if you want to change the timeout to 120 seconds, type 120 as shown in the following figure:
- Save the change.
Edge API
To configure the virtual host using the Edge API, do the following:
- Get the current virtual host configuration using the
Get virtual host API as shown below:
Public Cloud user
curl -v -X GET https//api.enterprise.apigee.com/v1/organizations/{organization-name}/environments/{environment-name}/virtualhosts/{virtualhost-name} -u <username>
Private Cloud user
curl -v -X GET http://<management-host>:<port #>/v1/organizations/{organization-name}/environments/{environment-name}/virtualhosts/{virtualhost-name} -u <username>
Where:
{organization-name} is the name of the organization
{environment-name} is the name of the environment
{virtualhost-name} is the name of the virtual host
Sample virtualhost configuration
{ "hostAliases": [ "api.myCompany,com" ], "interfaces": [], "listenOptions": [], "name": "secure", "port": "443", "retryOptions": [], "sSLInfo": { "ciphers": [], "clientAuthEnabled": "false", "enabled": "true", "ignoreValidationErrors": false, "keyAlias": "myCompanyKeyAlias", "keyStore": "ref://myCompanyKeystoreref", "protocols": [] }, "useBuiltInFreeTrialCert": false }
- Add the property
proxy_read_timeout
to the existing virtual host configuration JSON payload underproperties
with the value in seconds.For example, to change the I/O timeout to 120 seconds, add the
properties
code block as shown below:Sample updated virtual host configuration
{ "hostAliases": [ "api.myCompany,com", ], "interfaces": [], "listenOptions": [], "name": "secure", "port": "443", "retryOptions": [], "properties": { "property": [ { "name": "proxy_read_timeout", "value": "120" } ] }, "sSLInfo": { "ciphers": [], "clientAuthEnabled": "false", "enabled": "true", "ignoreValidationErrors": false, "keyAlias": "myCompanyKeyAlias", "keyStore": "ref://myCompanyKeystoreref", "protocols": [] }, "useBuiltInFreeTrialCert": false }
- Save the updated virtual host configuration in a file. For example,
virtualhost-payload.json
. - Update the
virtualhost
configuration with the change using the Update a virtual host API as follows:Public Cloud user
curl -v -X POST Content-Type: application/json https://api.enterprise.apigee.com/v1/organizations/{organization-name}/environments/{environment-name}/virtualhosts/{virtualhost-name} -d @virtualhost-payload.json -u <username>
Private Cloud user
curl -v -X POST Content-Type: application/json http://<management-host>:<port #>/v1/organizations/{organization-name}/environments/{environment-name}/virtualhosts/{virtualhost-name} -d @virtualhost-payload.json -u <username>
Where:
{organization-name} is the name of the organization
{environment-name} is the name of the environment
{virtualhost-name} is the name of the virtual host
Verifying I/O timeout on virtual hosts
This section explains how to verify that the I/O timeout has been successfully modified on the virtual host using the Edge API.
- Execute the
Get virtual host API to get the
virtualhost
configuration as shown below:Public Cloud user
curl -v -X GET https://api.enterprise.apigee.com/v1/organizations/{organization-name}/environments/{environment-name}/virtualhosts/{virtualhost-name} -u <username>
Private Cloud user
curl -v -X GET http://<management server-host>:<port #>/v1/organizations/{organization-name}/environments/{environment-name}/virtualhosts/{virtualhost-name} -u <username>
Where:
{organization-name} is the name of the organization
{environment-name} is the name of the environment
{virtualhost-name} is the name of the virtual host
- Verify that the property
proxy_read_timeout
has been set to the new value.Sample updated virtual host configuration
{ "hostAliases": [ "api.myCompany,com", ], "interfaces": [], "listenOptions": [], "name": "secure", "port": "443", "retryOptions": [], "properties": { "property": [ { "name": "proxy_read_timeout", "value": "120" } ] }, "sSLInfo": { "ciphers": [], "clientAuthEnabled": "false", "enabled": "true", "ignoreValidationErrors": false, "keyAlias": "myCompanyKeyAlias", "keyStore": "ref://myCompanyKeystoreref", "protocols": [] }, "useBuiltInFreeTrialCert": false }
In the example above, note that the
proxy_read_timeout
has been set with the new value of 120 seconds. - If you still see the old value for
proxy_read_timeout,
then verify that you have followed all the steps outlined in Configuring I/O timeout in virtual host correctly. If you have missed any step, repeat all the steps again correctly. - If you are still not able to modify the I/O timeout, then contact Apigee Edge Support.
Configuring I/O timeout on Routers
This section explains how to configure I/O timeout on the Routers. The I/O timeout can be
configured through the Router property
conf_load_balancing_load.balancing.driver.proxy.read.timeout
, which represents
the I/O timeout value in seconds.
To configure I/O timeout on the Routers, do the following:
- On the Router machine, open the following file in an editor. If it does not already exist, then create it.
/opt/apigee/customer/application/router.properties
For example, to open the file with
vi
, enter the following command:vi /opt/apigee/customer/application/router.properties
- Add a line in the following format to the
properties
file, substituting a value fortime_in_seconds
: - Save your changes.
- Ensure this properties file is owned by the
apigee
user as shown below:chown apigee:apigee /opt/apigee/customer/application/router.properties
- Restart the Router as shown below:
/opt/apigee/apigee-service/bin/apigee-service edge-router restart
- If you have more than one Router, repeat the above steps on all the Routers.
conf_load_balancing_load.balancing.driver.proxy.read.timeout=time_in_seconds
For example, to change the I/O timeout on the Router to 120 seconds, add the following line:
conf_load_balancing_load.balancing.driver.proxy.read.timeout=120
You can also modify the I/O timeout in minutes. For example, to change the timeout to two minutes, add the following line:
conf_load_balancing_load.balancing.driver.proxy.read.timeout=2m
Verifying I/O timeout on the Routers
This section explains how to verify that the I/O timeout has been successfully modified on the Routers.
Even though you use the token
conf_load_balancing_load.balancing.driver.proxy.read.timeout
to set the I/O timeout
on the Router, you need to verify if the actual property proxy_read_timeout
has
been set with the new value.
- Search for the property
proxy_read_timeout
in the/opt/nginx/conf.d
directory and check to see if it has been set with the new value as follows:grep -ri "proxy_read_timeout" /opt/nginx/conf.d
- If the new I/O timeout value is successfully set on the router, then the above command
shows the new value in all the virtual host configuration files.
The following is the sample result from the
grep
command above when the I/O timeout is 120 seconds:/opt/nginx/conf.d/0-default.conf:proxy_read_timeout 120; /opt/nginx/conf.d/0-edge-health.conf:proxy_read_timeout 1s;
In the example output above, notice that the property
proxy_read_timeout
has been set with the new value 120 in0-default.conf
which is the configuration file for the default virtual host. This indicates that the I/O timeout is successfully configured to 120 seconds on the Router. - If you still see the old value for the property
proxy_read_timeout
, then verify that you have followed all the steps outlined in Configuring I/O timeout on Routers correctly. If you have missed any step, repeat all the steps again correctly. - If you are still not able to modify the I/O timeout, then contact Apigee Edge Support.
What’s next?
Learn about Configuring I/O Timeout in Message Processor