-
Notifications
You must be signed in to change notification settings - Fork 626
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
[4.x]: DB Replica #15305
Comments
Just to be sure, you’re not getting the memory error if you remove the replica config settings, correct? |
That's correct, if I remove the replica settings, the website works normally without any issues at all |
How high up have you tried setting the memory limit? Have you confirmed that the memory limit changes are going into effect? (You can verify by removing the replica config (so the site loads) and going to Utilities → PHP Info and checking the Also check |
I tried 128M all the way to 1024M but the default PHP config for the server is 512M. I did make sure it changed by disabling it between changes and checking utilities section in the CMS. The memory limit change had no effect on the error The weird thing is that it worked on Craft 3, but fails to load on Craft 4 |
I’m guessing it’s due to an infinite recursion bug somewhere, that might be triggered by your replica config. It could be due to a module or plugin you have installed. Is there any chance you can send your database, Composer files, and any custom plugin/module files, over to [email protected] so we can try to reproduce and look into it from there? |
I can't at the moment, I would have to discuss this with the team. One thing I tried is to implement the replica settings on our testing sandbox environment, which is completely separate project without any custom plugins or modules and it comes back with the same error. |
Hi Brendon, I'm picking this up in the absence of Denis this week. Can I send the database for the sandbox app Denis mentions above to [email protected]? There are no custom plugins or modules. |
@bluestormdesign Sure, as long as the issue is reproducible, we should be able to work with that. |
@bluestormdesign @DenyEs I'm not able to reproduce this. Can you:
|
I can confirm that the DB_REPLICA_DSN_1 is pointing to a different database instance. I have also commented out 'bootstrap' => ['my-module'], and can confirm that nothing in my module is interfering. |
Running locally with a read replica same error: [10-Jul-2024 12:04:08 UTC] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted |
Likely related to yiisoft/yii2#14305 but we'll do some more digging to see if we can come up with a workaround. |
@bluestormdesign Did some more testing and added a new comment on yiisoft/yii2#14305 (comment) As a workaround until the underlying issue is addressed, it looks like you won't be able to use database read/write splitting and the DbCache component at the same time. |
@angrybrad Hi Brad, I tried to replace DbCache component with Redis to see if that's going to work with database read/write splitting but I am hitting a dead end with this configuration as well. Just with Redis alone, website loads up but the second I enable replica config, I get the PHP Fatal error you can see below. One thing changed tho, now it's pointing to the different function entirely - preloadSingles()
I had a look in my general.php config and tried to both enable and disable the option but it doesn't make a difference at all. This is my app.php file with redis and replica.
|
What happened?
Description
I am trying to set up DB replica on one of our websites and I am not having much luck. It used to work fine on Craft 3 but after an upgrade to Craft 4, I am getting memory exhausted error and the website won't load at all.
PHP memory_limit is set to 512M but no matter what I change it to, it has no effect on the issues I am having.
This is my app.php config
Steps to reproduce
Expected behavior
Website loads up without any issues
Actual behavior
Website is fully blank and the following error can be found in the phperrors.log file.
Craft CMS version
4.10.2
PHP version
8.3
Operating system and version
Mac OS Sonoma 14.5 as well as Ubuntu 22.04 LTS
Database type and version
MySQL 8
Image driver and version
No response
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered: