Retries most likely go beyond balancing the load balancing of Amazon or a network component (such as a router). I have seen similar behavior when using other load balancers (e.g. Citrix NetScaler).
Basically, a request receives an idle timeout at some level in the request chain. If this timeout does not send the proper HTTP 5xx status to the client (for example, it can just close the connection), then any components between the timeout source and the client may decide to retry the request depending on how they are configured.
Keeping track of which components trigger retries can be very difficult. My recommendation is to make sure your Rails applications always respond quickly to each other. If the requests cannot be completed quickly, consider a background / polling solution or a non-HTTP communication method (e.g. WebSockets).
user1454117
source share