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

Add PHP-FPM memory peak to scoreboard #14153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

flavioheleno
Copy link
Contributor

This PR adds a new entry to PHP-FPM's scoreboard to track peak memory usage.

This is useful to track memory usage and help better tune PHP/PHP-FPM configuration.

Performance impact should be minimal as it is only updated in request end (fpm_request_end).

@bukka
Copy link
Member

bukka commented May 12, 2024

You might want to read: #10600 (comment) . TLDR not sure if this is really useful as it just reports peak of the last request...

@flavioheleno
Copy link
Contributor Author

The idea behind this change is to record the largest peak in memory usage between requests.

From what I can understand from the code, the fpm_request_end function is executed for all requests and the treatment done by fpm_scoreboard_update_commit is what guarantees the recording of the largest peak (similar to the treatment done for active max), or am I wrong?

In general, we now have a better view of memory consumption, regardless of how often the extractor consumes data (as is the case when we use the data provided by full, which only provides data for the last request).

Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

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

I had a better look now and after thinking about it I think it actually makes sense to add it. We have got already some similar fields and I see the use case here. I will try to do a bit more testing but it should make it to 8.4

sapi/fpm/tests/status-basic.phpt Outdated Show resolved Hide resolved
sapi/fpm/tests/status-listen.phpt Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants