Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frankenphp-symfony: call gc_collect_cycles() after handling request #142

Merged

Conversation

dunglas
Copy link
Contributor

@dunglas dunglas commented Oct 26, 2023

Triggering the garbage collector after the request has been handled and when the worker may be idle prevents the garbage collection from being randomly done in the middle of the handling of a request (which delays the delivery of the HTTP response).

Another option, that is done by Laravel Octone, is to trigger the GC when a configurable amount of memory has been consumed instead of after every request.
I think this patch is good enough for FrankenPHP as usually many workers will be available.

Copy link
Member

@alexander-schranz alexander-schranz left a comment

Choose a reason for hiding this comment

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

Make sense, maybe we should do the same in other runtimes.

@dunglas dunglas force-pushed the perf/frankenphp-gc_collect_cycles branch from 1a23d9e to e08a151 Compare October 30, 2023 08:19
@alexander-schranz alexander-schranz merged commit da7093d into php-runtime:main Oct 30, 2023
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.

3 participants