[SERVER-59696] Include SBE plan cache as part of cache size metric Created: 31/Aug/21  Updated: 29/Oct/23  Resolved: 02/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Task Priority: Major - P3
Reporter: Joshua Lapacik (Inactive) Assignee: Alexander Ignatyev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-60339 Add support for $planCacheStats Closed
is depended on by SERVER-61241 Add a test to ensure plan cache size ... Closed
is depended on by SERVER-61248 Validate behaviour of stripping debug... Closed
Backwards Compatibility: Fully Compatible
Sprint: QO 2021-11-01, QO 2021-11-15, QO 2021-11-29, QO 2021-12-13, QO 2021-12-27, QO 2022-01-10, QO 2022-01-24, QO 2022-02-07
Participants:

 Description   

Right now the server metric `query.planCacheTotalSizeEstimateBytes` refers to the classic plan cache. We need to update this metric when we introduce the SBE plan cache.

Three options proposed by david.storch:

  1. Make this metric reflect the sum of the sizes of the classic plan caches and the SBE plan cache.
  2. Make this metric reflect the size of the classic plan caches only, omitting the size of the SBE plan cache.
  3. Make this metric reflect the size of the classic plan caches only, and introduce a new metric indicating the size of the SBE plan cache.


 Comments   
Comment by Githook User [ 02/Feb/22 ]

Author:

{'name': 'joshua', 'email': '80741223+jlap199@users.noreply.github.com', 'username': 'jlap199'}

Message: SERVER-59696 Include SBE plan cache as part of cache size metric
Branch: master
https://github.com/mongodb/mongo/commit/616ba6a01e803ab159edcca954131c5fe3a9b0ef

Comment by Joshua Lapacik (Inactive) [ 01/Nov/21 ]

After discussion, we've decided not to change the current implementation which reports the sum of both plan caches in the `query.planCacheTotalSizeEstimateBytes` metric. Just need to add a test.

Comment by David Storch [ 31/Aug/21 ]

Anton proposed the following, which is similar to option (3):

query: {
   planCacheTotalSizeEstimateBytes: {
      classic: 100, // we can pick better names
      sbe: 200,
      total: 300
   }
}

I'm a little unsure if we should go with this suggestion, however, since it changes the format of the planCacheTotalSizeEstimateBytes serverStatus metric. We will have to determine whether this is an acceptable change. The other reason for my hesitation is that, in the long run, it should be unusual to have both SBE and classic plan caches. As SBE starts to handle more and more queries, the classic plan cache (and indeed the entire classic engine) should be used less and less. Eventually we would have to change the format once again when phasing out the classic engine.

Generated at Thu Feb 08 05:47:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.