[Issue] Set process title when running cron job #34321
Labels
Area: Framework
Component: Cron
feature request
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Priority: P2
A defect with this priority could have functionality issues which are not to expectations.
Progress: done
Reported on 2.4.x
Indicates original Magento version for the Issue report.
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
Projects
This issue is automatically created based on existing pull request: #34186: Set process title when running cron job
Description
When managing a busy server, it's helpful to understand what each process is doing. Currently there is no visibility for a systems administrator to see what task the
bin/magento cron:run
process is currently performing. The most information that's available is that some job (or set of jobs) is running within a PHP process that was started via the system task scheduler (read: cron daemon). Because of the way that Magento spawns additional processes for some groups (depending on their configuration) it is possible to sometimes narrow down the list of possible tasks because the group name is listed in the command arguments.This pull request sets the title of the currently-running process to clearly list the group and job names.
Before screen-shot
After screen-shot
Related Pull Requests
None
Manual testing scenarios
bin/magento cron:run
when several long-running tasks are scheduledps
orhtop
on Unix - untested on Windows, but the functionality should work there too)Questions or comments
Should the path to Magento be listed in the process title too? If there are multiple Magento instances on a single server, they should be running under different users. I can't think of a sensible non-development environment where multiple Magento instances run under the same system user.
Contribution checklist
The text was updated successfully, but these errors were encountered: