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

Enable the PHP opcache and disable revalidation #149

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

deviantintegral
Copy link
Contributor

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

I noticed that the PHP opcache is not installed or enabled. The opcache takes compiled PHP files and stores them in memory, improving performance and reducing disk IO at a small memory cost. Even in development it's a good practice to have the opcache enabled.

Since we are running in docker, there is also no point in checking files with stat calls on each request to see if they have changed. Instead, users should generally pull or rebuild the image.

Benefits of this PR and context:

I noticed this on my server because surprisingly php-fpm had the biggest IO reads out of all processes. This is because I have an uptime app checking Heimdall every 60 seconds, causing the entire Laravel app to be re-read and compiled.

How Has This Been Tested?

I changed my local to build off of this PR instead of pulling the upstream image. As well, I confirmed the opcache was enabled by dropping a phpinfo.php file in the app and verifying that the opcache extension was showing hits.

I have only tested on amd64, and not ARM.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thanks for opening this pull request! Be sure to follow the pull request template!

@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/heimdall/v2.6.1-pkg-3e37565b-dev-6470ee8a6fad03d38bce7f99cf0b0632dfc5f568-pr-149/index.html
https://ci-tests.linuxserver.io/lspipepr/heimdall/v2.6.1-pkg-3e37565b-dev-6470ee8a6fad03d38bce7f99cf0b0632dfc5f568-pr-149/shellcheck-result.xml

Tag Passed
amd64-v2.6.1-pkg-3e37565b-dev-6470ee8a6fad03d38bce7f99cf0b0632dfc5f568-pr-149
arm64v8-v2.6.1-pkg-3e37565b-dev-6470ee8a6fad03d38bce7f99cf0b0632dfc5f568-pr-149

@aptalca aptalca self-assigned this Mar 1, 2024
@mrdavidburns
Copy link

This has been working well for me. Nice improvement!

@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/heimdall/v2.6.1-pkg-607ed74b-dev-b9dfbf14b6c81eb7e94632804ecb5076e27e5901-pr-149/index.html
https://ci-tests.linuxserver.io/lspipepr/heimdall/v2.6.1-pkg-607ed74b-dev-b9dfbf14b6c81eb7e94632804ecb5076e27e5901-pr-149/shellcheck-result.xml

Tag Passed
amd64-v2.6.1-pkg-607ed74b-dev-b9dfbf14b6c81eb7e94632804ecb5076e27e5901-pr-149
arm64v8-v2.6.1-pkg-607ed74b-dev-b9dfbf14b6c81eb7e94632804ecb5076e27e5901-pr-149

@aptalca aptalca merged commit 1aedaec into linuxserver:master Mar 7, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants