Amir’s new project: free websites for you or your AI agent, in 30 seconds.free websites · Try it

Backend · 2025 · Benchmark

Laravel Queue Pipeline

Benchmarking sync vs. queued processing on 1M items

A Laravel benchmarking system that compares synchronous and queue-based processing on large datasets, eliminating request timeouts.

  • 200K orders, 1M items
  • 8.4s → 1.2s responses
  • No request timeouts
Laravel Queue Pipeline: Benchmarking sync vs. queued processing on 1M items

The problem

Generating invoices and PDFs for thousands of orders inside a web request causes slow responses and timeouts.

What I built

  • Seeded high-volume datasets: 200,000 orders, 1,000,000 items, and 1,000 products.
  • Invoice generation for thousands of orders, comparing Eloquent ORM and Query Builder approaches.
  • Queue-based background processing with Redis and Laravel queue workers, monitored with Laravel Horizon.
  • Asynchronous PDF generation with DomPDF.

Results

  • Response time dropped from 8.4s to 1.2s, and request timeouts disappeared by moving work to background jobs.

Tech stack

  • PHP
  • Laravel
  • Redis
  • Laravel Horizon
  • DomPDF
  • MySQL

More projects

All projects →