docs: add container cache sizing guide#181
Conversation
Covers container memory budgeting, SizeLimit translation strategies, time-based vs size-based expiry tradeoffs, Kubernetes deployment example, common mistakes, and metric-driven tuning. Addresses documentation gap identified in #32 (container cache sizing). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request adds a comprehensive guide on effectively sizing Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Pull request overview
I have re-read .github/copilot-instructions.md in full.
Adds a new documentation guide to help engineers size and operate IMemoryCache safely in containerized deployments, aligning guidance with this repo’s metered cache metrics and the .NET runtime’s approved metrics design.
Changes:
- Add
docs/ContainerCacheSizing.mdcovering container-specific cache budgeting,SizeLimitstrategies, and operational monitoring guidance. - Provide concrete examples for count-based vs KiB-based sizing and a Kubernetes deployment snippet.
- Document key
MeteredMemoryCachemetrics to correlate with container memory/GC signals.
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable new documentation file, docs/ContainerCacheSizing.md, which provides comprehensive guidance on sizing IMemoryCache in containerized .NET applications. The content is well-structured and highly informative, covering crucial aspects from budget determination to monitoring. My feedback focuses on a minor formatting inconsistency within the 'Common Mistakes' section to enhance readability and visual coherence.
Set both requests.memory and limits.memory to 512Mi for Guaranteed QoS class. Add callout explaining why requests==limits matters for cache workloads. Reference: https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/ Reference: https://home.robusta.dev/blog/kubernetes-memory-limit/ Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
K8s QoS Fix (commit 07d12e7)Fixed the Kubernetes YAML example per review feedback: Before: Setting requests ≠ limits for memory is dangerous for cache workloads:
Added a callout explaining QoS classes and why
|
- Fix integer division in KiB sizing (ceiling division prevents oversubscription) - Clarify cache.estimated_size uses user-defined units, not bytes - Improve cache.entries description (entry count, not size units) - Add DON'T code example for ignoring cache metrics (consistency) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Adds
docs/ContainerCacheSizing.md— a guide for engineers deploying .NET applications withIMemoryCachein containers.What's Covered
System.Runtime.Cachingcgroup mismatch problemSizeLimit→ keep shared cache unboundedMeteredMemoryCachemetrics to watch and container signals to correlateContext
Addresses the container cache sizing documentation gap identified in #32. The migration cookbook covers this topic at a high level; this guide provides the detailed, actionable guidance for container deployments that was missing from this repo's docs.
Checklist