globalsign / mgo

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

too many goroutine created in mgo? #317

Closed tokingHong closed 5 years ago

tokingHong commented 5 years ago

image Is' so weird !!!! Under what circumstances will this problem occur?

Normal situation is below image

domodwyer commented 5 years ago

Hi @tokingHong

This is totally normal - mgo has an internal connection pool so queries can reuse open connections rather than having to perform the full handshake every time. This lowers latency and is fairly normal - the sockets in your screenshot are waiting in the pool as designed.

Hope this helps!

Dom