[SERVER-26815] ShardRemote::getConnString() is very expensive Created: 27/Oct/16 Updated: 29/Jan/18 Resolved: 06/Sep/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Misha Tyulenev | Assignee: | Misha Tyulenev |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Participants: |
| Description |
|
ShardRemote::getConnString() involves locking a mutex at ReplicaSetMonitor::getServerAddress and a building a string from scratch into a StringBuffer in SetState::getConfirmedServerAddress() |
| Comments |
| Comment by Misha Tyulenev [ 22/Nov/16 ] | |||||||||||||||||||||||
|
Per discussion with kaloian.manassiev according to the stack the call to getConnString() happens only on new connection establishment when the connection pool is being populated. | |||||||||||||||||||||||
| Comment by Misha Tyulenev [ 22/Nov/16 ] | |||||||||||||||||||||||
|
In my experiment it was a mongo shell connected to a db. every find command was getting into this. | |||||||||||||||||||||||
| Comment by Kaloian Manassiev [ 22/Nov/16 ] | |||||||||||||||||||||||
|
This only happens on new connection establishment, right? | |||||||||||||||||||||||
| Comment by Misha Tyulenev [ 22/Nov/16 ] | |||||||||||||||||||||||
|
Done an investigation if getConnString() is on any CRUD path collection.insert() however
| |||||||||||||||||||||||
| Comment by Kaloian Manassiev [ 28/Oct/16 ] | |||||||||||||||||||||||
|
Chunk::split is a fairly rare operation - to the extent that caching is not necessary. Can you please update the ticket description with the operations which are impacted? | |||||||||||||||||||||||
| Comment by Misha Tyulenev [ 28/Oct/16 ] | |||||||||||||||||||||||
|
kaloian.manassiev Its being called a lot - e.g its a part of Chhunk::split. Not sure if its a part of any CRUD. Its new, in 3.2 Shard just returned the cached CS. | |||||||||||||||||||||||
| Comment by Kaloian Manassiev [ 28/Oct/16 ] | |||||||||||||||||||||||
|
misha.tyulenev - what is the external impact of this? Is it being called on critical code paths and does impact CRUD operations or just maintenance calls and new connection establishment? Also - is it new in 3.4? |