I have a ruby ​​sinatra application running on nginx / passenger, and I often see requests becoming inexplicably inhibited. I wrote a script to call passenger status on my machine cluster every ten seconds and to display the results on a graph. Here is what I see:

The blue line indicates that the global waiting line is constantly increasing to 60. This is the average value on 4 cars, so when the blue line reaches 60, it means that each machine is maximized. I have a current user_max_pool_size value of 20, so that it reaches 3x the maximum pool size, and then supposedly discards subsequent requests.
My application depends on two key external resources - the Amazon RDS mysql backend and the Redis instance. Perhaps one of them periodically becomes slow or does not respond and thereby causes this behavior?
Can someone advise me how to get the stack trace to see if the bottleneck is here Amazon RDS, Redis or something else?
Thanks!
ruby redis passenger
esilver
source share