[DOCS-13943] Investigate changes in SERVER-40361: Reduce memory footprint of plan cache entries Created: 22/Oct/20 Updated: 13/Nov/23 Resolved: 22/Mar/21 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual, Server |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0, 4.2.12, 4.4.3, 4.0.23, 3.6.23, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Backlog - Core Eng Program Management Team | Assignee: | Naomi Pentrel (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Days since reply: | 2 years, 43 weeks, 6 days ago | ||||||||||||||||||||||||||||
| Epic Link: | DOCSP-9747 | ||||||||||||||||||||||||||||
| Story Points: | 2 | ||||||||||||||||||||||||||||
| Description |
DescriptionDownstream Change Summary There is a new setParameter 'internalQueryCacheMaxSizeBytesBeforeStripDebugInfo'. Its default value is 0.5 GB. The operator can increase the value of the parameter to allow more debug information to be stored in the plan cache, or reduce its value to save memory. By setting it to zero, no debug information will be stored alongside new plan cache entries. When the debug info for a plan cache entry has been stripped, $planCacheStats will return an entry that has the fields "queryHash", "planCacheKey", "isActive", "works", "timeOfCreation", "indexFilterSet", and "estimatedSizeBytes", but it will be missing the fields "createdFromQuery", "cachedPlan", "creationExecStats", and "candidatePlanScores". Note that "estimatedSizeBytes" is a new field which displays the estimated size in bytes of each plan cache entry. For documentation purposes, I'm not sure that we should document 'internalQueryCacheMaxSizeBytesBeforeStripDebugInfo', since hopefully the default will be appropriate for most applications. However, we should document the addition of the "estimatedSizeBytes" field to the $planCacheStats output. Description of Linked TicketFor some workloads, the per-collection query plan caches can consume too much memory. SERVER-34886 and SERVER-40360 together describe an architectural solution to this problem: turn the per-collection plan caches into a process-global plan cache, and bound the size of this new global cache in bytes rather than number of entries. However, we could also reduce the memory footprint of the plan cache by auditing the debug information it holds in memory. We have observed in the field that this problem is most severe when the user runs large queries; this can result in the information held in the plan cache for introspection taking up a lot of memory. Perhaps this debug information can be truncated if it exceeds some threshold, in order to reduce the amount of debug information present in exchange for avoidance of excessive memory consumption. The suspected worst offenders are:
Scope of changesImpact to Other DocsMVP (Work and Date)Resources (Scope or Design Docs, Invision, etc.) |
| Comments |
| Comment by Githook User [ 08/Apr/21 ] |
|
Author: {'name': 'Naomi Pentrel', 'email': '5212232+npentrel@users.noreply.github.com', 'username': 'npentrel'}Message: |
| Comment by Githook User [ 07/Apr/21 ] |
|
Author: {'name': 'Naomi Pentrel', 'email': '5212232+npentrel@users.noreply.github.com', 'username': 'npentrel'}Message: |
| Comment by Githook User [ 25/Mar/21 ] |
|
Author: {'name': 'Naomi Pentrel', 'email': '5212232+npentrel@users.noreply.github.com', 'username': 'npentrel'}Message: |
| Comment by Githook User [ 23/Mar/21 ] |
|
Author: {'name': 'Naomi Pentrel', 'email': '5212232+npentrel@users.noreply.github.com', 'username': 'npentrel'}Message: |
| Comment by Githook User [ 23/Mar/21 ] |
|
Author: {'name': 'Naomi Pentrel', 'email': '5212232+npentrel@users.noreply.github.com', 'username': 'npentrel'}Message: |
| Comment by David Storch [ 05/Jan/21 ] |
|
See my comment here in |