AWS Redis connections increased (Rails) Errno::ECONREFUSED

Asked 2 years ago, Updated 2 years ago, 103 views

The service was suspended due to Redis not being able to connect to the service in operation (about a year).
I think Redis's increased number of connections caused the situation to be unable to connect.
I asked because I don't know the cause.

configuration
AWS Redis cache.t2.small (parameter is default setting)
EC2 t2.medium

Applications
Rails

Using Redis
Managing Rails session data.

Redis Situation
When I checked the AWS CloudWatch, the following values for Redis increased.
Redis itself has not stopped.

CPU utilization 1% (typical) = > 20% (in case of failure)
Enter a description of the image here

Network Receive Byte 80947 (Typical) = > 52549839 (Failed)
Enter a description of the image here

Current Connection Count 9 (Typical) = > 94 (Failed)
Enter a description of the image here

Possible Cause
I think it's because of the load on Rails due to increased access.
However, the number of accesses (20 requests/sec) in case of failure is lower than the average (50 requests/sec).
Also, because of AWS Redis, I think only access within the same PVC will be allowed, so I don't think I'll be able to get a command from the outside.(Verified by telnet command from an external server) The IP of EC2 is a private IP, accessed from a stepping stone.

In this situation, if anyone knows what is better to look into or why the number of connections is increasing,
Could you tell me?
Thank you for your cooperation.

ruby-on-rails aws redis

2022-09-30 19:43

1 Answers

As a guess, cache.t2.small seems to lack network bandwidth because of its low network performance.

If the number of connections is small and the number of bytes received is large, I would like to check if there is a possibility that the value is set too large.

Also, if it is reproducible, I think it would be good to temporarily scale up to cache.m3.medium and see if it can be improved.


2022-09-30 19:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.