What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello community, in which container do I need to increase PHP's memory limit to avoid getting this k

USDAKA3PD
USDAKA3PD Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet
edited October 2020 in Docker

Hello community,
in which container do I need to increase PHP's memory limit to avoid getting this kind of error:

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

Comments

  • USDAKA3PD
    USDAKA3PD Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet

    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

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi Vlad, the error come during data import maybe?

  • USDAKA3PD
    USDAKA3PD Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet

    The error was returned while the Scheduler was suspended and I was trying to execute docker/sdk console queue:task:start sync.storage.product

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    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?

  • USDAKA3PD
    USDAKA3PD Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet

    in exception log I could find only this error

  • USDAKA3PD
    USDAKA3PD Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited October 2020

    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 ?

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    how much memory have you given to your docker?

  • USDAKA3PD
    USDAKA3PD Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet

    Allowed memory size of 1073741824 bytes exhausted

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    This is too little, I would say

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    Usually we recommend to have at least 4 GB

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    I put it to 8 since I’m running multiple envs at the same time

  • USDAKA3PD
    USDAKA3PD Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet

    I am on Linux, I don't need to increase Dockers resources, I need to increase the ram limit inside one of the containers

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    okay, makes sense then

  • USDAKA3PD
    USDAKA3PD Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet

    or decrease the number of messages read from the sync.storage.product queue

  • USDAKA3PD
    USDAKA3PD Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet

    found the solution, I had to add in config_local.php the following lines:


  • USDAKA3PD
    USDAKA3PD Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet

    the default value was 10k