502 Gateway Error
means that Cloudflare, which is used in the networking layer of Laravel Cloud, was unable to reach your application. This can happen when the instance serving your application becomes unresponsive. Common issues include:
APP_DEBUG=true
, you should expect higher memory usage through more verbose logging.1 process
). This is important as Horizon will automatically spawn workers based on the settings within your application’s config/horizon.php
file.
config/horizon.php
file via the maxProcesses
key. When Horizon starts, it will automatically spawn processes based on this value for each supervisor you define. In some cases, too many workers may cause an overallocation of memory.
config/horizon.php
file has a key under environments
that matches your APP_ENV
value, or includes an *
key as a fallback for when no matching environment is found. For more information, refer to the Horizon documentation.v5.31
. Older version of Horizon can be more aggressive in spawning workers on startup. Keep in mind that even if Horizon starts successfully, your application may still crash if spawning the maximum number of workers causes an overallocation of memory.queue:work
workers, onto worker clusters separate from your app cluster. This ensures that your application is still reachable, even if your job queues become stressed.