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

Multiple CommandTask memory issue #6

Open
kbond opened this issue Feb 14, 2020 · 2 comments
Open

Multiple CommandTask memory issue #6

kbond opened this issue Feb 14, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@kbond
Copy link
Member

kbond commented Feb 14, 2020

I have found when multiple CommandTask's are due at the same time it can hit your PHP memory limit. I'm not sure what the best way to combat this is. Maybe running tasks in another process somehow?

There are two workarounds I have found:

  1. Wrap the commands in a process:

    # instead of
    - task: my:command
    
    # use
     - task: 'bash:bin/console my:command'

    This works but removes the ability to catch exceptions (task will still fail if an exception in the command is thrown).

    Also, your environment isn't passed to the command automatically like when running an actual CommandTask. You would need to pass it as an argument:

     - task: 'bash:bin/console my:command --env=prod'
  2. Ensure CommandTask's do not run at the same time. Even one minute difference in frequency solves the issue. The cron hash expressions can help with this. If using a CompoundTask to ensure tasks run in a specific order this gets more complex, you need split up the CompoundTask and schedule the tasks after each other giving enough time for the previous to complete.

@kbond kbond added the help wanted Extra attention is needed label Apr 8, 2020
@parijke
Copy link

parijke commented Jul 15, 2020

Hi Kevin I am not that good of a programmer but if I can test something or think with you no problem

@kbond
Copy link
Member Author

kbond commented Jul 16, 2020

Thanks Paul, I don't have any ideas that don't require breaking architecture changes. I plan to revisit for 2.0.

I think the workarounds described above solve the problem but if you run into it and they don't, let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Development

No branches or pull requests

2 participants