Skip to content

Does Service Connect use persistent http connections

0

When one ECS task communicates with another via Service Connect using http 1.1, is the connection persistent?

We have an nginx ECS task that uses the auth request module to communicate with another ECS task for authorization.

  1. Can these requests between tasks take advantage of persistent http connections?
  2. If so, is there a way to verify by looking at CloudWatch metrics that connections are actually getting reused?
1 Answer
0

Yes, Service Connect does support persistent HTTP connections when ECS tasks communicate using HTTP 1.1. HTTP 1.1 assumes all connections to be persistent unless otherwise specified. In other words, persistent connections are the default behavior of any connection in HTTP 1.1. Service Connect doesn't modify the HTTP traffic, so the keep-alive functionality of HTTP 1.1 remains intact.

In your case, the requests between your nginx ECS task using the auth request module and another ECS task for authorization can take advantage of persistent HTTP connections. As HTTP 1.1 persistent connections are handled at the application level, and Service Connect doesn't interfere with this functionality, your tasks can benefit from connection reuse.

While there isn't a direct metric for connection reuse, you can infer this information by analyzing several CloudWatch metrics. ECS Service Connect supports HTTP/1, HTTP/2, gRPC, and TCP protocols, and provides metrics such as the number of requests, number of HTTP errors, and average call latency.

https://aws.amazon.com/blogs/aws/new-amazon-ecs-service-connect-enabling-easy-communication-between-microservices/

AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.