-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Memory limit quite low #182
Comments
Bump. Having the same issue. |
Hi, I have similar errors being thrown in my nextcloud install, any updates / working solutions to this? |
What should be the limit in your opinion? |
@pierreozoux make it optional with a default (docker ENV) option? |
Does anybody want to PR this? |
What would be the best workaround until this is implemented? I would like to set it to 512MB |
@monreal I used Ansible to update the .htaccess file inside the docker from 512M to 2G after the docker is deployed. Looks like the default is now 512M. |
@FriedCircuits for me it is still 128mb with 14rc. Do I have to change it manually in Nextcloud's .htaccess because it was not updated manually? Also I wonder why there is no php.ini at all |
So, I actually got memory_limit=512M in my .user.ini |
I am using the fpm-alpine image so i am not sure if it works for all images. Because both php-cli and php-fpm support variable substitions i would suggest to use a custom /usr/local/etc/php/conf.d/nextcloud.ini with variables which should be changeable by the user. This file could be installed by the Dockerfile. For Example nextcloud.ini memory_limit=${PHP_MEMORY_LIMIT} Dockerfile
Now the user can run this image with |
@ptrunk That would be great and would work better with docker swarm since the container can be rebuilt at anytime. I hope someone at nextcloud can resolve this as it coming up on a year. |
The php cli memory_limit problem is apparently fixed now by #460 but i am not sure a hardcoded value of 512M is the way to go because it still could be too low in some cases. If someone wants to try i have created a custom docker image based on docker pull registry.gitlab.com/p7k/docker-nextcloud/nextcloud-fpm:14.0.0-1 I would prefer to have this kind of configuration also for other variables instead of using a .user.ini file but this is just my personal opinion. |
@ptrunk Cool, I may it give it a try. I never could get the FPM to work with nginx/docker-proxy but now I am migrating to traefik so maybe it will work. In my case 512M isn't enough. I need at least 1G. I can't remember why I was hitting the limit. I have external mounts and elasticsearch setup. |
Hello everybody,
is not enough to make use of it - it instead still falls back to the 128M that PHP considers to be default. To actually use .user.ini I came up with the following solution:
This runs occ inside the container (in my case "nextcloud") as user 33 (which is www-data) but does it in a way so that PHP loads the configuration from .user.ini before. This way, you can configure whatever PHP option you want and it even is persistent if you made /var/www/html a docker-volume. |
I ended up making a new Dockerfile based on the official one. Way better than having to modify the image afterwards everytime time there is an update. I can just run my Ansible playbook to update the Dockerfile and rebuild image. |
I'm using the "linuxserver/nextcloud" image and I have the same issue. I tried to run |
@kjlhgfds Before I made the Docker image I was adding the memory limit to the nextcloud .htaccess file. That was the only way that worked for me. You have to make the change every time you redeploy the image so I did it with Ansible. |
I already have Did you add anything else ? |
@kjlhgfds I looked at my Ansible tasks to see how I did it. I did a regex and updated the current value already in the .htaccess in the /html directory and replaced 512M with 2G. |
@FriedCircuits I don't have a Here is my
|
@kjlhgfds I found this in my custom dockerfile that might help echo 'memory_limit=2G' > /usr/local/etc/php/conf.d/memory-limit.ini |
Hi,
The file
Because both files are located in a local directory it's very easy to change them. As soon as the container is restarted they are effective. No image generation required. Hope that helps. |
@lhurt the trick with the memory_limit setting in the nextcloud.ini sets for me the memory_limit on the "global" php level, whereas the "local" level is overwritten by the .htaccess file which has:
If I comment the memory limit in the .htaccess, then it works as expected, but this is still a manual workaround. How have you solved that? I am useing the nextcloud:14-apache image |
No. I'm using the nginx php-fpm image combination. Sorry. You could try to supersede the Hope that helps. |
A solution has been posted in #182 (comment), so I'll close this. |
My allowed memory size is 2 GB, but I still get this error for allocating just 16 MB.
Why does this happen? |
you don't need to override the entire nextcloud.ini anymore, there is a separate file for memory limit, its called memory-limit.ini make sure to create a file called memory-limit.ini to mount into, just put and then add this under the volumes section in docker-compose
|
@fareszr That's nice, is it documented somewhere so I can get more info about it? This is my docker container situation: root@76abe3b16f2a:/usr/local/etc/php/conf.d# cat nextcloud.ini setting that file memory-limit.ini would override the env variables referenced by nextcloud.ini? |
after investigating further, i think its better to just replace it directly in nextcloud.ini. |
You can simply set the environment variable PHP_MEMORY_LIMIT for your docker container (for instance "PHP_MEMORY_LIMIT=2G"). PHP_UPLOAD_LIMIT is also available to set the max size of files to be uploaded. |
The php memory_limit is not set and thus defaults to 128M. This results in a crash, when I try to generate thumbnails of photos taken with a standard digital camera using
occ preview:generate-all
.A larger memory limit is required for this standard task. It should be ok to increase it on installations that target only small groups of users.
Possible solutions:
The text was updated successfully, but these errors were encountered: