Skip to content

docs(redis): explain cache tag keys without TTL filling Redis#2362

Open
Soner (shyim) wants to merge 4 commits into
mainfrom
docs/redis-cache-tag-cleanup
Open

docs(redis): explain cache tag keys without TTL filling Redis#2362
Soner (shyim) wants to merge 4 commits into
mainfrom
docs/redis-cache-tag-cleanup

Conversation

@shyim

@shyim Soner (shyim) commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

Documents a real customer case: a cache Redis that kept running out of memory even though volatile-lru was configured correctly.

  • Shopware's redis_tag_aware cache adapter stores a tag index in Redis (one set per cache tag) so related entries can be invalidated together. These tag-index keys have no TTL.
  • When cached items expire, their entries in the tag sets are not removed, leaving orphaned members. Because volatile-lru only evicts keys with a TTL, these persistent sets accumulate and can never be evicted — under high cache churn Redis eventually has too little evictable data left and returns OOM errors.
  • A full cache Redis is healthy; the real problem is having too many keys without a TTL. Symfony does not prune the tag sets automatically, so operators must do it on a schedule.

Changes:

  • guides/hosting/performance/caches.md — new self-contained section "Cache tags and keys without a TTL", written for a junior dev/DevOps reader: a TTL + eviction primer, a before/after walkthrough of how orphaned tags accumulate, a redis-cli INFO keyspace self-diagnosis, and a scheduled-cleanup fix.
  • guides/hosting/infrastructure/redis.md — a cross-linked warning in the ephemeral-data section where volatile-lru is recommended.
  • .wordlist.txt — added evictable and OOM.

Related links

Checklist

  • I reviewed affected links, code samples, and cross-references, including PageRef references where relevant.
  • I added or updated redirects in .gitbook.yaml if pages were moved, renamed, or deleted.
  • I updated .wordlist.txt (and sorted it) if spellcheck flags new legitimate terms.
  • Any required dependent changes in downstream modules have already been merged and published.
  • This pull request is ready for review.

Notes

shopware-redis-cli-helper currently lives under a personal GitHub account. If linking a personal repo from official docs is undesirable, I can drop it and keep only the FroshTools reference.

The redis_tag_aware adapter stores tag-index sets without a TTL. Under high cache churn these accumulate orphaned entries that volatile-lru can never evict, eventually starving the cache Redis of evictable data and causing OOM errors despite a correct eviction policy.

Adds a junior-friendly section to the caches guide (TTL/eviction primer, a before/after walkthrough, a redis-cli diagnosis, and a scheduled-cleanup fix via FroshTools or shopware-redis-cli-helper), plus a cross-linked warning in the infrastructure Redis guide.
@shopware-dev-docs-connector

shopware-dev-docs-connector Bot commented Jul 1, 2026

Copy link
Copy Markdown

Developer Docs healthcheck

Status: Completed with success.
Repository: shopware/docs
Commit: 60ac282
Preview: https://developer-documentation-9ndekhcn3-shopware-frontends.vercel.app
Workflow run: #4329

@shyim Soner (shyim) marked this pull request as ready for review July 1, 2026 07:34
Copilot AI review requested due to automatic review settings July 1, 2026 07:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds operational documentation to help operators diagnose and prevent Redis OOM conditions caused by persistent (no-TTL) tag-index keys created by Symfony/Shopware’s tag-aware Redis cache adapter, and cross-links the guidance from the Redis infrastructure page. Also updates the spellcheck allowlist for newly introduced terms.

Changes:

  • Added a new section explaining how tag-index sets without TTL can accumulate and prevent volatile-lru from freeing memory.
  • Added a warning callout in the Redis “Ephemeral data” section linking to the new cache-tag guidance.
  • Added OOM and evictable to .wordlist.txt for spellcheck.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
guides/hosting/performance/caches.md Adds a new “Cache tags and keys without a TTL” section with diagnosis and cleanup guidance.
guides/hosting/infrastructure/redis.md Adds a warning callout about no-TTL tag-index keys and links to the cache-tag section.
.wordlist.txt Adds OOM and evictable to the spellcheck wordlist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread guides/hosting/performance/caches.md Outdated
Comment thread guides/hosting/infrastructure/redis.md Outdated
@Isengo1989 Micha Hobert (Isengo1989) added the Improvement PR created to append/modify info in the existing article label Jul 1, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread guides/hosting/performance/caches.md Outdated
@Isengo1989

Copy link
Copy Markdown
Contributor

Thx for the PR Soner (@shyim) 👍

I believe this is very helpful for understanding the quirks of a key-value cache. Often, it is a black box to many, and we should keep documenting like this 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement PR created to append/modify info in the existing article

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants