Memory_limit, post_max_size and upload_max_filesize, which values are recommended

Hello,
I’ve read on the Nextcloud docs that “post_max_size” and “upload_max_filesize” needed to have the same values:
https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html#configuring-your-web-server

However, usually it’s recommended not to enter for “post_max_size” a value higher of “memory_limit” because could cause issue.
Doesn’t it make more sense to have a “post_max_size” that is less than or equal to the “memory_limit” and change only the value for “upload_max_filesize”?

To consider that on Plesk (the control panel that I use on my server) I can’t apply these values only for the subdomain where it is located Nextcloud (e.g. nextcloud.mydomain.com) but for the whole hosting (e.g. mydomain.com, othersubdomain.mydomain.com .etc.).

So, is it correct to use these values for a Nextcloud installation with a limit of “2G” for single upload or could I have some problem?

memory_limit = 512M
max_execution_time: 3600
max_input_time: 3600
post_max_size = 2G
upload_max_filesize = 2G

Thanks.

Nextcloud clients are uploading the files in chunks (small pieces) hence lower limits should work. If you run a lot of apps make sure to increase the memory limit. If you are using 3rdparty clients (e.g. windows network mount, cyberduck, nautilus or any other day client) higher limites are necessary (because those does not use chunking).

1 Like

Thanks.

Just out of curiosity, what are the configurations for the following parameters you usually use?
memory_limit =
max_execution_time =
max_input_time =
post_max_size =
upload_max_filesize =

1 Like

php_admin_value[memory_limit] = 1024M
php_admin_value[upload_max_filesize] = 256M
php_admin_value[post_max_size] = 256M

I’m using the defaults for max_execution_time. But nextcloud changes the max_execution_time itself to a higher value. (that might change in the future).

1 Like