I was wondering whether it is possible to have multiple php worker with upstart. My problem is that one worker isn't enough for my tasks anymore so I'd love to have 2-3 worker. Even better would be to automatically scale the number of workers.
I'm using:
# Info
description "My PHP Worker"
author "Jonathan"
# Events
start on startup
stop on shutdown
# Automatically respawn
respawn
respawn limit 20 5
# Run the script!
# Note, in this example, if your PHP script returns
# the string "ERROR", the daemon will stop itself.
script
[ $(exec /usr/bin/php -f /path/to/your/script.php) = 'ERROR' ] && ( stop; exit 1; )
end script
Found at Run php script as daemon process thx @Jonathan