proxy endpoint "api.timeout" behavior questions

Context: Apigee Edge public cloud

I recently discovered a back end target is taking too long to complete and times out, resulting in a 504. At this time, the proxy and virtual host are all using the default timeout settings, so I time out around 55 seconds.

I've done a bit of researching for an approach to configuring the how to increase the timeout for this proxy. Following the guidelines here https://docs.apigee.com/how-to-guides/configuring-io-timeout-best-practices I set the virtual host "proxy read timeout" to 120 seconds. I also set the target HTTPTargetConnection "io.timeout.millis" to something slightly lower, 115 seconds. I no longer get the 504s, as desired. Solution found...maybe?

When researching, I ran across a property for the Proxy Endpoint called "api.timeout". As far as I can tell, this setting doesn't seem to have any effect regardless of other timeout configurations. Even if it is the only timeout configuration, I just end up timing out on the default 55 seconds at the message processor. If I set it lower to either the proxy_read_timeout or io.timeout.millis, it still times out based on the larger values.  Based on this section in the docs https://docs.apigee.com/api-platform/reference/endpoint-properties-reference#cloud-timeouts and this detail further up in that same doc:

"Note, however, that raising the system timeouts could result in performance issues, because all proxies without an api.timeout setting use the new, higher load balancer, router, and message processor timeouts. So configure other API proxies that don't require longer timeouts to use lower timeouts. For example, the following sets an API proxy to time out after 1 minute..."

it suggests that "api.timeout" is designed to provide a per-proxy way to override a larger timeout. This might be something I'd want to provide to users, but I cannot seem to make it work. Even a 1ms api.timeout setting, by itself, doesn't cause a 504. 

Is this a correct reading of this functionality? Should api.timeout cause the entire proxy to respond to the client with a 504 if it is configured lower than proxy_read_timeout and/or io.timeout.millis? Given that the best practice is to have higher timeout values on earlier components, I wonder if I am reading this correctly.

0 0 164
0 REPLIES 0