Hey guys, this is not strictly a Ruby question, but
I'm hoping someone has an idea on what direction I should take to solve this problem.
So, long story short, I've got a rails app that is pretty basic. It takes a request, does a look up in the database, and renders a page. Not much to it.
The problem is that I am getting way too much simultaneous traffic, and something cannot handle the load. I've watched the server load, and it stays extremely low. Its almost as if nothing is happening on the server. but watching the passenger log, its taking requests so fast that I can't even read them as they go by. What I've noticed is that more than half of the requests are given an error from passenger because the queue is full.
example:
[ 2014-01-10 01:44:05.5626 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:05.6456 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:05.7382 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:06.3655 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:06.5241 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:07.0543 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:07.0946 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:07.6608 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:07.7320 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:07.9560 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:08.2632 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:08.6933 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:08.7497 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:08.8230 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:08.9167 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:09.1765 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:09.4440 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:09.6939 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:09.6972 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:09.7366 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:09.8361 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:10.1738 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
[ 2014-01-10 01:44:10.2735 6822/7fa08d717700 Pool2/Group.h:411 ]: Request queue is full. Returning an error
I've done some reading on passengers page here:
http://www.
modrails.com/documentation/Users%20guide%20Apache.html#
PassengerMaxRequestQueueSize
as well as on a few forums. I understand the problem in theory, but I don't understand what is causing it. The server clearly doesn't have a problem handling the load. its a 2 gb box on rackspace and this is the only app currently running on it.
So there is an obvious thing I can do which is increase the queue size, but that will likely make the problem worse for users. Is there something at the application level that just can't handle the volume of requests? Or is this possibly a mysql problem? I'm using a dedicated database cloud solution so i'm not sure how I can check the health on that. Not sure how to see the load, etc.
Also, it may be worth noting that I increased the max connection pool in database.yml to 10 from the default of 5. I did this a while ago for other reasons, this could have an affect either positive, or negative.
Since my expertise do not lie in the server administration area, the best I can come up with is to set up a load balancer with smaller app servers to split up the traffic. I'm just hoping there is some simple config that I can do to fix it instead as it doesn't appear to be putting a dent on my server load.
Any ideas would be amazing!