Add memory pooling for chunks fetched from cache when fine-grained caching is enabled #4255
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does
We've just rolled out the fine-grained chunks fetching and caching in zone-a of a dev cluster and all metrics are better than other 2 zones (where the new feature is disabled). This is good!
However, I noticed that the allocated bytes / sec in zone-a is a bit higher compared to other zones. After some profiling, looks like the main difference is given by
memcache.Client.GetMulti()
:The old implementation uses a memory pool for the data fetched from the cache, while the new one doesn't. I think (but not sure) that @dimitarvdimitrov experimented with it and didn't see any real benefit. However, I would like to challenge it and experiment again with a memory pool (see my test results in #4255 (comment)).
Which issue(s) this PR fixes or relates to
N/A
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]