zenstruck / schedule-bundle

Schedule Cron jobs (commands/callbacks/bash scripts) within your Symfony application.
MIT License
384 stars 20 forks source link

Per command `ionice` or `nice` #83

Closed FluffyDiscord closed 1 year ago

FluffyDiscord commented 1 year ago

Would it be possible to add configuration for using ionice and nice per symfony command? Right now it needs to be set globally, for example in the cron, for all commands/tasks.

kbond commented 1 year ago

Hi @FluffyDiscord, if I understand ionice and nice correctly, the only task type that would benefit would be the ProcessTask. I'm not sure how we could utilize for the other task types.

FluffyDiscord commented 1 year ago

These could be also used for CommandTasks. You might have some rather heavy bulk operations using commands and ensuring that command runs "at low priority" might just prevent the other server's services from fighting with resources

kbond commented 1 year ago

How could this work? The CommandTask's are run in the same process as schedule:run.

FluffyDiscord commented 1 year ago

That's the thing. The bundle would need to spawn new process for each command that wants to use one/both of them.

kbond commented 1 year ago

Hmm, yeah, I think that's a bit out of scope. I'm looking to sunset and eventually deprecate\archive (once 5.4 is EOL) this library in favor of symfony/scheduler.