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

how set memory limit in laradock? #2353

Closed
crodrigor opened this issue Nov 3, 2019 · 8 comments
Closed

how set memory limit in laradock? #2353

crodrigor opened this issue Nov 3, 2019 · 8 comments

Comments

@crodrigor
Copy link

No description provided.

@garbinmarcelo
Copy link
Contributor

garbinmarcelo commented Nov 6, 2019

PHP memory limit? If it is I managed to change the file: php-fpm/laravel.ini

after alteration, rebuild the instance..

docker-compose build --no-cache php-fpm

If this helped you, close this issue.

@crodrigor
Copy link
Author

Container memory, but I resolved using docker-compose --compatibility up -d.
Added in docker-compose.yml in my container the lines

  deploy:
    resources:
      limits:
        cpus: "0.50"
        memory: "150M"

I don't know if it's the most correct solution.

@SinaKheirkhah
Copy link

PHP memory limit? If it is I managed to change the file: php-fpm/laravel.ini

after alteration, rebuild the instance..

docker-compose build --no-cache php-fpm

If this helped you, close this issue.

man i just want to say this, "God Bless You" I Love you because of this solution which worked perfectly <3

@Emmanuerl
Copy link

PHP memory limit? If it is I managed to change the file: php-fpm/laravel.ini

after alteration, rebuild the instance..

docker-compose build --no-cache php-fpm

If this helped you, close this issue.

i tried this and it didn't work. I solved mine by opening the php-fpm/${php_version}.ini file (in my case is was 7.3) and changing the memory_limit (as at now it's on line 404).

@pathros
Copy link

pathros commented May 25, 2022

How do you change the value of memory-limit right at the php-worker container?

I have just installed and it outputs 128M:

docker container exec _php-worker_1 php -r "echo ini_get('memory_limit').PHP_EOL;"
128M

Also, it seems there're at least two or more .ini files:

docker container exec constancias_php-worker_1 ls -lah /usr/local/etc/php                                                                                                           ─╯
total 156K   
drwxr-xr-x    1 root     root        4.0K May 25 21:22 .
drwxr-xr-x    1 root     root        4.0K May 13 23:01 ..
drwxr-xr-x    1 root     root        4.0K May 24 19:24 conf.d
-rw-r--r--    1 root     root       71.1K May 25 21:22 php.ini-development
-rw-r--r--    1 root     root       71.2K May 25 21:22 php.ini-production

while in the workspace the result is -1.

docker container exec _workspace_1 php -r "echo ini_get('memory_limit').PHP_EOL;"                                                                                       
-1

I want to change it to -1 in the php-worker, since I get the error:

[2022-05-25 15:44:28] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2621440 bytes) {"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 2621440 bytes) at /var/www/vendor/laravel/framework/src/Illuminate/View/ComponentSlot.php:21)
[stacktrace]
#0 {main}
"}

@hankin-h-k
Copy link

@pathros Did you find a solution? how to change the memory_limit of php-worker

@huiyonghkw
Copy link

@pathros Did you find a solution? how to change the memory_limit of php-worker

The same question

@huiyonghkw
Copy link

How do you change the value of memory-limit right at the php-worker container?

I have just installed and it outputs 128M:

docker container exec _php-worker_1 php -r "echo ini_get('memory_limit').PHP_EOL;"
128M

Also, it seems there're at least two or more .ini files:

docker container exec constancias_php-worker_1 ls -lah /usr/local/etc/php                                                                                                           ─╯
total 156K   
drwxr-xr-x    1 root     root        4.0K May 25 21:22 .
drwxr-xr-x    1 root     root        4.0K May 13 23:01 ..
drwxr-xr-x    1 root     root        4.0K May 24 19:24 conf.d
-rw-r--r--    1 root     root       71.1K May 25 21:22 php.ini-development
-rw-r--r--    1 root     root       71.2K May 25 21:22 php.ini-production

while in the workspace the result is -1.

docker container exec _workspace_1 php -r "echo ini_get('memory_limit').PHP_EOL;"                                                                                       
-1

I want to change it to -1 in the php-worker, since I get the error:

[2022-05-25 15:44:28] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2621440 bytes) {"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 2621440 bytes) at /var/www/vendor/laravel/framework/src/Illuminate/View/ComponentSlot.php:21)
[stacktrace]
#0 {main}
"}

see #3504 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants