-
-
Notifications
You must be signed in to change notification settings - Fork 292
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 not observed for AbstractHydrator.php #2201
Comments
The steps to reproduce do not indicate how exactly you are setting the env var. Did you set it via Shlink installer? |
Yes I did. |
Hmmm, yeah, I think I know what's going on. Tl;dr For simplicity, Shlink "promotes" config options as env vars, that way they can be handled the same once the app is bootstrapped. However, config options are promoted as env vars at one specific point, but this particular one is being read before the config is loaded at all, making it fall back to the default value. Specifically here Line 16 in 9afc787
For people providing the options as actual env vars this would not happen, but I didn't realize about this particular scenario. I see some possible short term/temporary solutions:
The long term solution would involve making Shlink set the option again after the config has been read, but anything executed before that point would not be affected. I think that's negligible. |
Thanks for the solutions. For now I went ahead and implemented a function of my script (that is already wrapping around shlink-cli to obtain the information I am interested in) to obtain data weekly in a loop from the start to end date to workaround this issue. It is really better that way for me anyway as the host system (a remote micro server) only has 1GB of ram in the first place. |
I have just released v4.2.1, which includes a fix for this. |
Shlink version
4.2.0
PHP version
8.3.11
How do you serve Shlink
Self-hosted nginx
Database engine
MySQL
Database version
8.0.39
Current behavior
Memory limit is set as
MEMORY_LIMIT' => '768M'
however this is not observed by shlink for all functions and some still error with a memory limit of 512 mebibytesExpected behavior
I expect that the MEMORY_LIMIT applies to all functions of shlink
Minimum steps to reproduce
536870912 bytes
(which is exactly 512 mebibytes)The text was updated successfully, but these errors were encountered: