Fine-Tuning PHP 8.1 Advice

I am running a brand new installation of Nextcloud 26 on Ubuntu Server 22.04 OS. Also running Apache2 and PHP 8.1. After adding the BOOKMARKS application the error shown below started appearing:

The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply opcache.interned_strings_buffer to your PHP configuration with a value higher than 8.

I am assuming my PHP 8.1 needs to be fine-tuned in order to fix the error shown above. Currently my PHP 8.1 paremeters are configured as shown below:

memory_limit = 512M
upload_max_filesize = 200M
max_execution_time = 360
post_max_size = 200M
date.timezone = America/New_York
opcache.enable=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1

Already added the line below to my config/config.php
‘memcache.local’ => ‘\OC\Memcache\APCu’,

Additionally, I already tried fine-tuning the opcache.interned_strings_buffer=8 to “16” and it was a temporary fix because the same error came back.

In closing, can anybody in the community please post the optimum PHP 8.1 parameter configurations that will prevent the error shown above from appearing while also providing the best performance results.

Any advice welcome. Thank you for your time.

You’ll have to find your best values according to your system / ram etc.

My NC has 16GB RAM (elasticsearch, opcache, hpb enabled etc.) and i use 32 instead of 8.

That mustn’t be your best values (!)

Have also a look here
OPCache interned strings buffer anpassen - Foxly IT - Blog
and here
Server tuning — Nextcloud latest Administration Manual latest documentation
and also here
Nextcloud Installationsanleitung - Carsten Rieger IT-Services
(this guide set opcache.internet… to 64)

Chrissi55,
Thanks for your post. My Ubuntu Server hardware is as follows:

PC Manufacturer = ASUS
PC Asus Model = PN51-E1-BB7000XTD1
CPU = AMD Ryzen 7 5700U Mobile Processor, 1.8 GHz (12M Cache)
LAN = Realtek RTL8125B-CG
RAM = 64GB DDR4 3200
Boot Drive = 500GB NVME Samsung 980

I was thinking since this server is going to serve big media files I should try a configuration like the one shown below which I found on a different post. My server has 64GB of RAM so I think 16GB allocation should not be a problem. Is my assumption correct? Can anybody please provide an opinion on whether my server configuration shown above is a good match for the PHP 8.1 configuration shown below:

memory_limit = 1024M
upload_max_filesize = 16G
post_max_size = 16G
date.timezone = America/New_York
output_buffering = Off

Lastly, can anybody in the community please clarify the following. By setting the “output_buffering = Off” parameter to OFF does this mean all of the Opcache parameters shown below can be disabled by commenting them out in the my PHP.ini file?

opcache.enable=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1

I am thinking such a setup will eliminate the " OPcache interned strings buffer is nearly full" error I am getting hit with right now in my manually installed Nextcloud 26 environment.

Any advice welcome and thank you for your time.

Then try this config and reboot the server and check what log says …

opcache.enable=1
opcache.interned_strings_buffer=64
opcache.max_accelerated_files=100000
opcache.memory_consumption=256
opcache.save_comments=1
opcache.revalidate_freq=1
opcache.validate_timestamps=0

Chrissi55,
Thanks for your post. What is your opinion of the configuration shown below? I have combined your 7 opcache lines you posted with the 5 other lines I found from another post. Is the configuration shown below a good configuration for a server like mine with 64GB of RAM?

memory_limit = 1024M
upload_max_filesize = 16G
post_max_size = 16G
date.timezone = America/New_York
output_buffering = Off

opcache.enable=1
opcache.interned_strings_buffer=64
opcache.max_accelerated_files=100000
opcache.memory_consumption=256
opcache.save_comments=1
opcache.revalidate_freq=1
opcache.validate_timestamps=0

Hi slipstream,

looks good so far, i have set my memory_limit higer 2G, and my upload is nearly equal.

In …/nextcloud/,user.ini i set
output_buffering=0 as well

hope these settings fits your needs :+1:

Chrissi55, thnx for your post. I have an update. I made the php.ini change and got a problem when i updated to nextcloud version 26.0.1 covered in the link below,
https://help.nextcloud.com/t/missing-index-error-after-installing-nextcloud-26-01-update/160871

Do you think my missing index error is related to the change to my php.ini file? Any advice welcome from anybody in the community.

After Upgrade have you run the following occ commands?

sudo -u www-data php /var/www/nextcloud/occ →

→ db:add-missing-indices

Add missing indices to the database tables

→ db:add-missing-columns

Add missing optional columns to the database tables

→ db:add-missing-primary-keys

Add missing primary keys to the database tables.

These should be done after every upgrade (IMHO)