Skip to content

[Docs] Explain the cost of FileSessionStore GC and how to run it out of band - #595

Merged
chr-hertel merged 3 commits into
modelcontextprotocol:mainfrom
chr-hertel:docs-file-session-gc
Oct 14, 2026
Merged

chr-hertel merged 3 commits into
modelcontextprotocol:mainfrom
chr-hertel:docs-file-session-gc

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

FileSessionStore::gc() scans the whole session directory, inline on ~1% of requests, so busy servers pay for it on random requests.

  • explain the cost in the GC section of docs/run/sessions.md
  • show how to disable inline GC and call gc() from cron instead
  • point to Psr16SessionStore, where the cache expires sessions itself

Fixes chr-hertel#75

🤖 Generated with Claude Code

@chr-hertel chr-hertel added this to the 0.9.0 milestone Oct 13, 2026
@chr-hertel chr-hertel added documentation Improvements or additions to documentation Server Issues & PRs related to the Server component labels Oct 13, 2026
@chr-hertel
chr-hertel requested a balanced review from Copilot October 13, 2026 23:35

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.

🟢 Approval recommended

The documentation accurately reflects the implementation and provides a valid configuration example.

0 open findings

What changed in this PR

Documents the performance cost of file-session garbage collection and how to move it outside request handling.

Changes:

  • Explains FileSessionStore::gc() directory-scanning cost.
  • Adds an out-of-band cron example and PSR-16 alternative.
File Description
src/​Server/​Session/​FileSessionStore.php Documents GC scaling behavior.
docs/​run/​sessions.md Adds external GC setup guidance.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

🟡 Changes recommended

The network-filesystem warning incorrectly attributes risk to file locking that the implementation does not use.

1 open finding

🧠 Review effort: Balanced

Comment thread docs/run/sessions.md Outdated
…g file locking in FileSessionStore'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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.

🟢 Approval recommended

The documentation accurately reflects the session-store APIs and runtime behavior.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@chr-hertel
chr-hertel merged commit edeebee into modelcontextprotocol:main Oct 14, 2026
28 checks passed
@chr-hertel
chr-hertel deleted the docs-file-session-gc branch October 14, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server] FileSessionStore GC cost grows with the number of sessions

2 participants