Forum: Ferret "Max pool size" - connection error

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 Max Williams (max-williams)
on 2009-02-12 11:42
On our server, which is nginx with an 8-mongrel cluster, and a
ferret_server for searching, we get an intermittent error when doing
ferret searches - always on the same index (for the User class).  I
don't know why it's always this same index - it's smaller, with less
indexed fields, then some of the other indexes, and is generally

When the error occurs, i get this in the log:

`rescue_action': #<ActiveRecord::ConnectionTimeoutError: could not
obtain a database connection within 5 seconds.  The max pool size is
currently 5; consider increasing it.>

ActiveRecord::ConnectionTimeoutError (could not obtain a database
connection within 5 seconds.  The max pool size is currently 5; consider
increasing it.):

This seems to be random but my suspicion is that it's to do with
mongrel.  If you keep doing the same search, you're effectively randomly
given a mongrel, which then accesses the ferret server to do the search.
So maybe some of the mongrels can connect and some can't?  Now, our site
isn't very busy (it's a subscriber-only site), so it's unlikely that 6
or more mongrels are trying to do a search at the same time - and
looking in the log, before the crash, i can't see any other searches
going on.

With reference to the pool size, i'm not even sure which database it's
talking about - is that ferret's own database, rather than our standard
application database?  It's at this point that the gaps in my knowledge
start to show....

anyway, grateful for any help/advice/insight...

73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 Max Williams (max-williams)
on 2009-02-13 17:01
Just in case anyone was wondering, or more likely, in case anyone
encounters this problem and happens to google to this post, then i fixed
it (at least, it hasn't broke yet) by adding this option to the end of
my options in config/database.yml:

pool: 8

(8 because we have 8 mongrels running)
This topic is locked and can not be replied to.