mongodb/mongo — pull request #278 by crumbjp (2012-08-06 07:15:50+00:00)
Title: Add configulations ("maxSpareConnPools" "connPoolTimeout") to mongos

I'm Hiroaki Kubota from rakuten.co.jp. (hiroaki.kubota@mail.rakuten.com)

We are using the MongoDB with sharding structure.
And connect to the Mongo-Sharding from approximates 100 web servers
(that have 50 httpd process per server).
We also run the "mongos" on each web server.

Nomally the number of the connections between "mongs" and "mongod" is apploximates 55.
It's the good form !
But sometimes, the number of the connections raise to 300-350 on every web server.
And the "mongod" would refuse to connect from "mongos" more than 20000 as the limit of the mongod.

So we want to control the connection pool in the "mongos".

You already provide us the "maxConns" configulation.
However "maxConns" affects client side of the "mongos".

It's unuseful for us.

So we added some configulations to control "mongos" more minutely.
- maxSpareConnPools
50 is default.
It's used in PoolForHost::getStaleConnections()

- connPoolTimeout
1800 is default.
It's used in PoolForHost::StoredConnection::ok()
It's hardcoded now.

Please review it and accept this pull-request.

Regards,