Skip to content

feat(http): introduce session cleanup strategies#2068

Open
innocenzi wants to merge 2 commits into3.xfrom
refactor/session-cleanup
Open

feat(http): introduce session cleanup strategies#2068
innocenzi wants to merge 2 commits into3.xfrom
refactor/session-cleanup

Conversation

@innocenzi
Copy link
Member

@innocenzi innocenzi commented Mar 23, 2026

Closes #2061

This pull request refactors session clean up to allow the choice between cleaning up sessions after every request (the current behavior), cleaning up session after random requests (2/100 chance), or disabling session cleanup in favor of a schedule-based clean up.

The database session installer has been removed in favor of a session installer, which allows choosing a driver (file, redis, database), and allows specifying the clean up strategy (except if Redis is chosen). When the session cleanup is disabled, the installer suggests installing the scheduled cleaning up command.

CleanShot 2026-03-23 at 19 50 48

@github-actions
Copy link

github-actions bot commented Mar 23, 2026

Benchmark Results

Comparison of refactor/session-cleanup against 3.x (610423b083473f2830a38ecd0099a2daba18a96e).

Open to see the benchmark results
Benchmark Set Mem. Peak Time Variability
ContainerBench(benchRegisterDefinition) - 6.714mb 0.00% 1.716μs -5.00% ±0.62% -77.79%
ViewRenderBench(benchPlainHtml) - 21.956mb 0.00% 496.914μs -7.51% ±2.82% +11.07%

Generated by phpbench against commit 516412c

@innocenzi innocenzi marked this pull request as draft March 23, 2026 19:01
@innocenzi innocenzi marked this pull request as ready for review March 23, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve performance of session cleanup

1 participant