The issue you're experiencing with Laravel Horizon, where supervisors keep respawning with new PIDs, is not typical behavior. This can happen due to several reasons, such as configuration issues, process management problems, or server resource constraints. Here are some steps you can take to troubleshoot and potentially resolve the issue:
-
Check Supervisor Configuration: Ensure that your Horizon configuration file (
config/horizon.php) is set up correctly. Pay special attention to theenvironmentssection to ensure that the supervisor settings are appropriate for your environment. -
Review Process Management: If you're using a process manager like Supervisor (not to be confused with Horizon's supervisors), ensure that it's configured correctly. A misconfiguration can cause processes to restart unexpectedly.
Example Supervisor configuration for Horizon:
[program:horizon] process_name=%(program_name)s command=php /path-to-your-project/artisan horizon autostart=true autorestart=true user=your-username redirect_stderr=true stdout_logfile=/path-to-your-project/storage/logs/horizon.log -
Check System Resources: Ensure that your server has enough resources (CPU, memory) to handle the processes. If the server is under heavy load, it might kill processes, causing them to respawn.
-
Inspect Logs: Although you mentioned that logs don't show anything, double-check both Laravel logs (
storage/logs/laravel.log) and system logs for any errors or warnings that might provide clues. -
Update Dependencies: Since you're using Laravel 5.8, ensure that all your dependencies, including Horizon, are up to date. There might be bug fixes in newer versions that address this issue.
-
Check for Zombie Processes: Sometimes, zombie processes can cause issues with process management. Use a command like
ps aux | grep horizonto check for any orphaned or zombie processes and kill them if necessary. -
Consider Upgrading: If possible, consider upgrading your Laravel application to a more recent version. Laravel 5.8 is quite old, and newer versions of Laravel and Horizon might have improvements and bug fixes that resolve this issue.
If none of these steps resolve the issue, consider reaching out to the community with detailed information about your setup, including your Horizon configuration and any relevant logs. This can help others provide more targeted assistance.