简体   繁体   English

我从 cloudhub 得到 HTTP:GATEWAY_TIMED_OUT

[英]I am getting HTTP:GATEWAY_TIMED_OUT from cloudhub

I am using a requestor connector in mule 4 for calling an API.我在 mule 4 中使用请求者连接器来调用 API。 That API takes 24 minutes to send back the response to requestor. API 需要 24 分钟才能将响应发送回请求者。 So when I am running my application in cloudhub, I am getting HTTP:GATEWAY_TIMED_OUT , error_code: 504 .因此,当我在 cloudhub 中运行我的应用程序时,我得到HTTP:GATEWAY_TIMED_OUT , error_code: 504

The response timeout I am setting in the requestor is 24 minutes and connection idle timeout is set to default(30000ms)我在请求者中设置的响应超时为24 分钟,连接空闲超时设置为默认值(30000 毫秒)

How can we update the response timeout of cloudhub?我们如何更新cloudhub的响应超时?

I understand that you are making an HTTP request to a REST API implemented as an application deployed in CloudHub.我了解您正在向 REST API 发出 HTTP 请求,该请求已作为部署在 CloudHub 中的应用程序实现。 You probably are using an URL that goes through CloudHub load balancer (example https://myapp.us-e1.cloudhub.io/api/... ).您可能正在使用通过 CloudHub 负载均衡器的 URL(例如https://myapp.us-e1.cloudhub.io/api/... )。 The load balancer has a fixed 5 minutes that can not be changed . 负载均衡器有一个固定的 5 分钟不能更改 Note that 24 minutes is a lot of time to keep connections resources open.请注意,24 分钟是保持连接资源打开的大量时间。

Some alternatives could:一些替代方案可以:

  • Restructure your application to operate in an asynchronous manner.重组您的应用程序以异步方式运行。 This might require significant effort.这可能需要付出巨大的努力。
  • Skip the load balancer tier and connect to the application worker directly using its DNS name (example https://mule-worker-myapp.us-e1.cloudhub.io:8082/api/... ).跳过负载均衡器层并使用其 DNS 名称直接连接到应用程序工作线程(例如https://mule-worker-myapp.us-e1.cloudhub.io:8082/api/... Be aware that going this way you will lose the benefits of using a load balancer.请注意,采用这种方式您将失去使用负载均衡器的好处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM