Hello community, in which container do I need to i...
# docker
g
Hello community, in which container do I need to increase PHP's memory limit to avoid getting this kind of error:
Copy code
PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /data/vendor/spryker/util-encoding/src/Spryker/Service/UtilEncoding/Model/Json.php on line 55

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /data/vendor/spryker/util-encoding/src/Spryker/Service/UtilEncoding/Model/Json.php on line 55
ErrorException - Exception: FATAL ERROR - Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) 
in /data/vendor/spryker/util-encoding/src/Spryker/Service/UtilEncoding/Model/Json.php (55)

Command: /data/vendor/bin/console queue:task:start sync.storage.product

Trace: 
#0 /data/vendor/spryker/error-handler/src/Spryker/Shared/ErrorHandler/ErrorHandlerEnvironment.php(99): Spryker\Shared\ErrorHandler\ErrorHandler->handleFatal()
#1 [internal function]: Spryker\Shared\ErrorHandler\ErrorHandlerEnvironment->Spryker\Shared\ErrorHandler\{closure}()
#2 {main}
when executing the following command:
docker/sdk console queue:task:start sync.storage.product
or maybe someone can tell what should I add in config_local.php to decrease the number off messages loaded from the
sync.storage.product
queue
I have changed the memory limit in
spryker_b2b_dev_zed_us_1
and
spryker_b2b_dev_zed_eu_1
, restarted the containers but the error is still there
m
Hi Vlad, the error come during data import maybe?
g
The error was returned while the Scheduler was suspended and I was trying to execute
docker/sdk console queue:task:start sync.storage.product
m
Ok, sometimes it happend when to much expcetion are thrown and php go quickly out of memory.. Have u checked your exception log during sync storage?
g
in exception log I could find only this error
I know it is a memory limit issue, do you know in which container should I increase the memory limit ? or how to decrease the number of messages read from the
sync.storage.product
queue ?
l
how much memory have you given to your docker?
g
Allowed memory size of 1073741824 bytes exhausted
l
This is too little, I would say
Usually we recommend to have at least 4 GB
I put it to 8 since I’m running multiple envs at the same time
g
I am on Linux, I don't need to increase Dockers resources, I need to increase the ram limit inside one of the containers
l
okay, makes sense then
g
or decrease the number of messages read from the
sync.storage.product
queue
found the solution, I had to add in config_local.php the following lines:
Copy code
$config[SynchronizationConstants::DEFAULT_SYNC_STORAGE_QUEUE_MESSAGE_CHUNK_SIZE] = 1000;
$config[SynchronizationConstants::DEFAULT_SYNC_SEARCH_QUEUE_MESSAGE_CHUNK_SIZE] = 1000;
👍 1
the default value was 10k