Help choosing best PHP 8.2 settings for turnkey instance

Setup

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.2
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.65
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • -
  • PHP version (e.g, 8.3):
    • 8.2
  • Is this the first time you’ve seen this error? (Yes / No):
    • -
  • When did this problem seem to first start?
    • -
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • turnkey template Proxmox
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

  • intro:

    • sorry but this is the first time posting here, but ive struggled to find a post that will help me with my particular setup. Pardon my lack of knowledge, im most certainly on the extreme left side of the dunning kruger graph. ive been running off of google and these forums, but i just want to triple check if what im doing is actually correct. im trying to find what settings to change that will optimize my next cloud instance for the fastest possible upload/download speed and general performance. i will try to break my post down and include as much information as possible.
  • expected load and setup:

    • my server will be used by my family, mostly for photo/video storage, and i personally use it for backing up files on my pc.
    • currently the Nextcloud server is running on a Proxmox turnkey container, whatever preinstalled template is used for proxmox. ive updated Nextcloud to v32, and PHP is running 8.2, non FTM i think.
  • hardware:

    • currently the container is assigned 16 threads and 64gb RAM, which i think might be overkill but i have plenty of resources. if this configuration causes issues i can switch it upon recommendation.
  • current PHP setup:

    • The turnkey webmin shows two available PHP configs, one for apachie2 and one for CLI. ive made changes to both configurations such as increasing max upload and post size to 1G, increasing max upload time, max file uploads to 64, enabling OPcache and setting the memory consumption to 4096.
  • current performance

    • currently with my setup, im getting up to 40 MB/s when uploading large files on college WIFI, but it does slow down to <10MB/s or even <1MB/s occasionally (small files i think). This i think is the wifi giving me a bottleneck, but i still want a optimized setup.
    • im currently seeing ~2.2 GB of ram usage doing a file sync as im writing this post, however usage does not stop even after a sync pause.
  • goal:

    • now im not sure if these settings will actually increase the performance or hurt other things, these are just what i found to do on the internet. however, regardless of my current setup, i want to shift the bottleneck to internet/hard drive speed.

Hello, yes, the Wi-Fi and its speed are always a bottleneck; there’s not much you can do about it.

Here are my PHP settings. They work perfectly for me, and all the Nextcloud instances I manage run great with them. Others will surely have improvements, but maybe this will help you a little.

You need the php.ini file from Apache2.

nano /etc/php/8.2/apache2/php.ini

I use the following values. You will of course need to adjust the memory_limit value for your own needs.

memory_limit = 4096M
upload_max_filesize = 20G
post_max_size = 20G
date.timezone = Europe/Berlin
output_buffering = Off

opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=20
opcache.max_accelerated_files=30000
opcache.revalidate_freq=1
opcache.save_comments=1

Some values ​​are disabled by default; you need to remove the # at the beginning.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.