globalsign / mgo

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

Only one mongos router used for each session #183

Open wangke1020 opened 6 years ago

wangke1020 commented 6 years ago

Hi, I've been working on testing write benchmark with mgo client on mongo cluster. It seems that only one mongos router get write operations for each session. If the mongos router is restarted, session will be switch to another mongos router. I think write operations should be banlanced to all mongos router for the sake of performance, Is it supported?

domodwyer commented 6 years ago

Hi @wangke1020

It only uses 1 mongos, you're right - it should be easy enough to change it to balance between the two (I think I once saw a fork that did this already) but it's not something we've implemented because we run fairly large machines and haven't hit the limits - we'd happily accept a PR though!

Dom