globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Allow configurable load balancing strategies, add a uniformRandom #295

Closed kahuang closed 5 years ago

kahuang commented 6 years ago

strategy

Useful for when talking to mongoS instead of a cluster of mongoD's directly. The BestFit algorithm will form hotspots on particular mongoS when we want to share the load across all mongos that we are connected to

maitesin commented 6 years ago

Hi @kahuang,

Thanks for your contribution, but can you write some test that checks the functionality you just added?

kahuang commented 6 years ago

Happy to add tests, what kind of tests did you have in mind?

Looking at the tests, I don't see anything for the current load balancing algorithm (BestFit), so am unsure what kind of tests you are looking for.

kahuang commented 5 years ago

Any updates on this? This is basically necessary for any large deployment of mongo using mongos.

domodwyer commented 5 years ago

Hi @kahuang

I think we're more likely to go with the latency aware uniform node selection algorithm (thanks @xdg!) though there are a few edge cases to cover off before it's landed, including test coverage.

Thanks for taking the time to open a PR though - it's really appreciated.

Dom