Timeout

1,867 views
Skip to first unread message

Pasha Seliverstov

unread,
Sep 21, 2020, 7:00:03 PM9/21/20
to api-gateway-users
Hello,

I am getting the next error:

{
    "code": 504,
    "message": "upstream request timeout"
}

It looks like the gateway has timeout set to 15 seconds. Where/how to configure Gateway timeout?

Best regards,
Pasha

toddbeckman

unread,
Sep 23, 2020, 1:53:20 PM9/23/20
to api-gateway-users
Hi, this is a good question. At the present, it is not possible to configure this timeout. We have filed an internal feature request for this, but it also helps if you file an official public feature request.

- Todd

Pasha Seliverstov

unread,
Sep 23, 2020, 1:55:38 PM9/23/20
to api-gateway-users

Josh Einhorn

unread,
Sep 23, 2020, 2:30:49 PM9/23/20
to Pasha Seliverstov, api-gateway-users
Hi Pasha,

That link is documenting the shape of a specific request ("wait for operation") sent to the Service Management API. This is tangentially related to API Gateway, but is not at all related to the timeout settings of your gateways. As Todd said, you are right to be confused on how to configure this because it is not yet configurable. This is on the roadmap, and as mentioned we also have a FR to track your specific request internally.

In the meantime, we can actually raise the default timeout (within reason) without much work. Would this help in the short-term?

-Josh

--
You received this message because you are subscribed to the Google Groups "api-gateway-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-gateway-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/api-gateway-users/bd44bb4a-d713-44b4-b02e-973a3242c689n%40googlegroups.com.


--
Josh Einhorn | Software Engineer | joshe...@google.com | 1-215-837-1102

Pasha Seliverstov

unread,
Sep 23, 2020, 2:39:11 PM9/23/20
to api-gateway-users
Hi Josh,

Thanks for detailed explanations. 

It would be great if you can increase the default timeout from 15 seconds to 60 seconds. However the ideal would be 540 seconds, because the maximum timeout for Google Function is 540 seconds.

Best regards,
Pasha

toddbeckman

unread,
Sep 23, 2020, 3:07:13 PM9/23/20
to api-gateway-users
~60 seconds timeout would be reasonable to implement. A longer timeout would be tougher, however.

- Todd

Josh Einhorn

unread,
Sep 23, 2020, 5:20:24 PM9/23/20
to toddbeckman, api-gateway-users
Apologies Pasha, we had misunderstood the error you posted. It turns out the error is for the backend timeout, which is indeed configurable using the deadline backend setting in your backend OpenAPI extension. Can you try that?

That said, there is still currently a hard upper limit of 60 seconds. We have started investigation on achieving the 540 second timeout you mentioned though.

-Josh

Pasha Seliverstov

unread,
Sep 23, 2020, 5:52:50 PM9/23/20
to api-gateway-users
Hi Josh,

Thank you! It looks like it works.

Best regards,
Pasha

Message has been deleted
Message has been deleted

Josh Einhorn

unread,
Dec 15, 2020, 1:15:10 PM12/15/20
to Brian, api-gateway-users
Hi Brian,

To change the backend timeout from 15s up to 60s, use the deadline backend setting in your backend OpenAPI extension. Let us know if that addresses your issue.

-Josh

On Tue, Dec 15, 2020 at 9:15 AM Brian <br...@squadle.com> wrote:
Has the upper limit been changed to 60 seconds for API Gateway or is it still at 15 seconds? I'm currently hitting the limit with one of my calls depending on the amount of changes involved in the request. 

Brian

unread,
Dec 15, 2020, 1:18:07 PM12/15/20
to api-gateway-users
Yep that worked thank you.

Thanh Nguyenphuoc

unread,
Jun 7, 2022, 11:36:54 AM6/7/22
to api-gateway-users
I tried to set deadline: 700 but I got the error: 

 API Config has a backend with the request deadline set to 700.000000 seconds. This exceeds the maximum deadline of 600 seconds.

In the docs, we can set up to unlimit: https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#deadline

Reply all
Reply to author
Forward
0 new messages