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

adjust opcache and jit values #2762

Merged
merged 1 commit into from
Jun 15, 2023
Merged

adjust opcache and jit values #2762

merged 1 commit into from
Jun 15, 2023

Conversation

szaimen
Copy link
Collaborator

@szaimen szaimen commented Jun 14, 2023

Address #2755
and #2795

@szaimen szaimen added 3. to review Waiting for reviews enhancement New feature or request labels Jun 14, 2023
@szaimen szaimen added this to the next milestone Jun 14, 2023
@szaimen szaimen requested a review from MichaIng June 14, 2023 16:53
Copy link
Member

@MichaIng MichaIng left a comment

Choose a reason for hiding this comment

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

It does not hurt, but most likely won't help either, see: #2755 (comment)

@szaimen szaimen force-pushed the enh/noid/adjust-jit branch from fc811ba to a984d9e Compare June 15, 2023 11:11
@szaimen szaimen changed the title adjust JIT to 4M adjust opcache and jit values Jun 15, 2023
@szaimen szaimen requested a review from MichaIng June 15, 2023 11:11
@szaimen szaimen merged commit 89e0be6 into main Jun 15, 2023
@delete-merged-branch delete-merged-branch bot deleted the enh/noid/adjust-jit branch June 15, 2023 13:29
@@ -91,11 +91,12 @@ RUN set -ex; \
# set recommended PHP.ini settings
# see https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
Copy link

Choose a reason for hiding this comment

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

The documentation still recommends opcache.jit_buffer_size = 128M. Which one is the source of truth?

Copy link
Member

Choose a reason for hiding this comment

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

The documentation is wrong at this point. Not sure about early PHP 8.0 versions, but all 8.1/8.2/8.3 versions do not use more than a little above 1 MiB of this buffer (with one NC instance), and since OPcache size overall is 128 MiB, using 128 MiB for JIT alone cannot work.

It should be also noted that JIT in general works on x86 only, not on ARM.

Choose a reason for hiding this comment

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

could the documentation then be updated please?

Copy link
Member

Choose a reason for hiding this comment

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

@MichaIng
Copy link
Member

MichaIng commented Mar 29, 2024

@szaimen
Was there a particular reason to raise the overall OPcache (and interned strings buffer) size as well? Were there cases where 8 MiB JIT, 32 MiB interned strings and cached PHP scripts really used up more than 128 MiB?

Of course a warning was thrown when 128 MiB JIT use up all of the 128 MiB of the overall OPcache alone (reserving it like interned strings buffer does), and I guess reducing it to 8 MiB alone solved the issue, while the OPcache size can remain at its default 128 MiB then (and interned strings buffer at 32).

The regular OPcache does not occupy the system memory, unless it is really used by cached scripts, but the as well raised interned strings buffer does, regardless whether it is really used or not. So at least 32 MiB system memory could be freed presumably without any downside.

EDIT: Oh, I recommended it myself, as JIT raises overall OPcache as well, according to my tests linked above 😅.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants