0

I have an ECS service deployed; a docker image which does some calculation based on some data in a Elasticache cluster (redis) But response time seems to be long, compared to the same service tested locally with a local redis; tests done using docker compose

Setup deployed on: eu-west-1

Any idea what could be the issue ?

  • Tested ECS service + Elasticache redis = Slow (same processing: 25 min)

  • Tested local service + Elasticache redis = Slow (same processing: 25 min)

  • Tested local service + local redis = Fast (same processing: 10 min)

  • Tested with a bigger Elasticache instance type : cache.m7g.xlarge

metrics 1 test

metrics 2 test

3
  • 2
    Network latency seems like it could be the culprit, given that your time from ECS exactly matched that of your local machine. Verify that you have a direct route from the ECS instance to the Redis cluster. Some level of latency can't be avoided: when you connect via localhost you're bypassing the physical network and its hops between routers. That should only be an issue if you are making an enormous number of requests (on the order of hundreds or thousands per second). Commented May 10, 2024 at 12:50
  • I would be looking at the CPU usage graphs for both the ECS service and the ElastiCache service during your test, just to make sure you don't have a CPU bottleneck in your cloud configuration. As mentioned above though it probably is network related. I assume the ECS task and the ElastiCache cluster are in the same VPC? What do the network usage metrics look like for those services in CloudWatch when you are running this test? Commented May 10, 2024 at 14:26
  • Yes i checked what you suggested, the ECS and Elasticache are both in the same vpc, and also checked the metrics while running some tests, they look good for me (i added screenshots of the metrics) Commented May 13, 2024 at 10:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.