Skip to content

Supervisor Process Management

This machine uses Supervisor to manage processes for multiple projects. Configuration files are located in /usr/local/etc/supervisor.d/.

ProcessConfig FileDescriptionPort
redisredis.iniRedis service (shared)6379
factory-horizonfactory-horizon.iniQueue management (Laravel Horizon)-
factory-reverbfactory-reverb.iniWebSocket service (Laravel Reverb)8080
factory-schedulerfactory-scheduler.iniScheduled task runner-
ProcessConfig FileDescriptionPort
innocn-horizoninnocn-horizon.iniQueue management (Laravel Horizon)-
innocn-reverbinnocn-reverb.iniWebSocket service (Laravel Reverb)8081
innocn-schedulerinnocn-scheduler.iniScheduled task runner-

Prerequisites

Both projects require the following in their .env:

  • QUEUE_CONNECTION=redis
  • BROADCAST_CONNECTION=reverb

Common Commands

bash
supervisorctl status                          # View status of all processes
supervisorctl restart all                     # Restart all processes
supervisorctl restart factory-horizon         # Restart Factory queue
supervisorctl restart innocn-horizon          # Restart innoshop.cn queue
supervisorctl stop all                        # Stop all processes
supervisorctl start all                       # Start all processes
supervisorctl tail factory-horizon            # View real-time logs

Log Locations

Process logs are stored in each project's storage/logs/ directory:

  • Factory: storage/logs/{horizon,reverb,scheduler}.log
  • innoshop.cn: storage/logs/{horizon,reverb,scheduler}.log
  • Redis: Factory/storage/logs/redis.log

Notes

  • schedule:work is a persistent process and does not require a system crontab
  • For production, it is recommended to use crontab + schedule:run instead of schedule:work
  • Horizon dashboard URL: http://your-domain/horizon
  • The two projects use different Reverb ports: Factory uses 8080, innoshop.cn uses 8081
  • Redis is shared and only needs one instance