Skip to content

Conversation

mathiasgrimm
Copy link
Contributor

@mathiasgrimm mathiasgrimm commented Aug 3, 2025

To display queue metrics, Vapor loads all failed_jobs and filters the period (1m, 5m, 10m, 30m, 1h, 24h, 7d, 30d) in memory. When the failed_jobs table has a large number of rows, usually as a result of not pruning failed_jobs on a regular basis, it would cause Queue Metrics to fail with HTTP status 502.

getTable was made public via laravel/framework#56384

As a workaround, we could run the following as a command:

php artisan queue:prune-failed --hours=720

Or we could also add this as a scheduled job:

Schedule::command('queue:prune-failed --hours=720')
    ->daily();

This will delete every failed job that is older than 30 days.

Note: In another PR, we could also filter all the other filter options (id, queue, query)

To display queue metrics, Vapor loads all `failed_jobs` and filters the period (1m, 5m, 10m, 30m, 1h, 24h, 7d, 30d) in memory.
When the failed_jobs table has a large number of rows, usually as a result of not pruning failed_jobs on a regular-basis, it would cause Queue Metrics to fail with HTTP status 502.

`getTable` was made public via laravel/framework#56384

Note: In another PR, we could also filter all the other filter options (id, queue, query)
@taylorotwell taylorotwell merged commit 1ec2f5c into 2.0 Aug 4, 2025
3 checks passed
@taylorotwell taylorotwell deleted the failed-jobs-filter branch August 4, 2025 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants