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

Processing queues results in out of memory errors #6136

Open
graber-1 opened this issue Oct 15, 2024 · 0 comments
Open

Processing queues results in out of memory errors #6136

graber-1 opened this issue Oct 15, 2024 · 0 comments

Comments

@graber-1
Copy link

Describe the bug
This happens when invoking a Drush process from a drush command:

    $site_alias = $this->siteAliasManager()->getSelf();
    $process = $this->processManager()->drush($site_alias, QueueCommands::RUN, ['some_queue_name']);
    $process->run($process->showRealtime()->hideStdout());

The same queue is processed with cron without out of memory errors, the queue has around 1000 items.

Workaround
I implemented processing in batches, something like:

    $site_alias = $this->siteAliasManager()->getSelf();
    $process = $this->processManager()->drush($site_alias, QueueCommands::RUN, ['some_queue_name']);
 
   do {
      // Enqueue a batch of items.
        $this->someEnqueuer->enqueueBatch($sandbox);

        // Process queue.
        $process->run($process->showRealtime()->hideStdout());
      }

    } while (!$this->someEnqueuer->someIsFinishedMethod());

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

1 participant