我希望有人能够对我所面临的问题有所了解 . 我有如下所述的架构,我将编写流量来自实例的步骤 .

  • 请求命中域名,这是一个A记录,别名为AWS ALB DNS名称 .

  • 从这里,流量然后被路由到特定端口上的代理实例(原因,为什么我坚持应用程序负载余额,是因为我不能简单地将A记录指向URL /域和端口 . 此外,我正在使用网络套接字) .

  • 流量点击上游,上游发送响应一直返回 .

注意:我在其间使用代理实例来获得ALB绑定的“静态”IP地址 . 根据分配的后端IP地址,仅动态更改代理实例上的IP地址 .

Problem is huge initial delay 用curl测试后,我发现请求最初只是超时的IP地址,然后在几分钟后被路由到ALB IP地址 . 如何克服这个问题?

ALB要求至少传播两个子网,但只有一个是公共的 .

~ ❯❯❯ curl -v app1.domain.com
* Rebuilt URL to: app1.domain.com/
*   Trying "some_public_ip_adress_a"...
* TCP_NODELAY set
* Connection failed
* connect to "some_public_ip_adress_a" port 80 failed: Operation timed out
*   Trying "some_public_ip_adress_b"...
* TCP_NODELAY set
* Connected to app1.domain.com ("some_public_ip_adress_b") port 80 (#0)
> GET / HTTP/1.1
> Host: app1.domain.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 26 Jul 2018 10:39:31 GMT
< Content-Type: text/html
< Content-Length: 3700
< Connection: keep-alive
< Server: nginx/1.12.1
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: authorization,Content-Type
< Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, HEAD, DELETE
< X-FRAME-OPTIONS: SAMEORIGIN
< X-XSS-Protection: 1
< Accept-Ranges: bytes
< Last-Modified: Sat, 23 Jun 2018 21:06:06 GMT
<
<!doctype html><!--