The Wire · Showcase
SOLID QUEUE CUTS JOB DISPATCH OVERHEAD, RAILS FIXES SCHEMA MIGRATION DEFAULTS
By RepoJournal · Filed · About Rails
Solid Queue eliminated redundant database queries in its hottest path, cutting unnecessary round-trips on every bulk job enqueue while Rails corrected a schema.rb default it shipped with reservations.
The Solid Queue team shipped a performance fix [1] that removes wasteful row reloading after job dispatch and schedule operations. The library was issuing two database statements per execution table to re-read jobs already in memory. On high-volume job queues, this doubles the overhead of `perform_all_later`. Paired with a new recursive CTE optimization [4] for PostgreSQL's DISTINCT queries on large job tables, Solid Queue is getting leaner. The CTE approach sidesteps MySQL's Loose Index Scan limitation by walking the B-tree index directly on distinct queue names. Rails itself course-corrected on schema migration handling [2] [3], changing the default sort order for dumped schema migrations to reverse chronological instead of lexicographic. The maintainers called the original default "painful" and expected merge conflicts to surface the issue in production apps. Windows users on Solid Queue will see signal handling simplified [5] with QUIT trapping removed from that platform. The queue will also now respect Rails application timezones for scheduled tasks [6] instead of forcing server-configured time, eliminating a common source of confusion in multi-timezone deployments.
One email a day. Unsubscribe in one click.
What actually shipped in Rails, written up every day — commits, pull requests, releases, and security advisories.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review and reset schema.rb sort defaults if you have merge conflicts in db/schema.rb after next Rails merge rails/rails [plan]
- → Update Solid Queue to the latest version for job dispatch performance gains rails/solid_queue [monitor]
- → Verify recurring job timing if using Solid Queue on Rails with non-UTC timezones rails/solid_queue [plan]
References
- [1] Avoid reloading job rows after dispatch and schedule rails/solid_queue
- [2] Let dump_schema_migrations_sort_by be :reverse by default ↗ rails/rails
- [3] Merge pull request #58166 from rails/fxn/change-default rails/rails
- [4] Improve DISTINCT queries on PostgreSQL via recursive CTE ↗ rails/solid_queue
- [5] Remove trapping QUIT on Windows rails/solid_queue
- [6] Automatically use Rails or a default timezone for the schedule ↗ rails/solid_queue