Horizon-PG brings the power of Laravel Horizon to PostgreSQL. It is specifically designed for high-performance queue monitoring using PostgreSQL instead of Redis, bridging the gap between database durability and Redis-like speed.
Through advanced PostgreSQL tuning, Horizon-PG achieves Redis-level performance while maintaining full ACID compliance.
| Metric | Horizon-PG (Optimized) | Redis (Standard) |
|---|---|---|
| Throughput | ~363 jobs/s | ~507 jobs/s |
| Latency | 2.7ms | 2.0ms |
- UNLOGGED Tables: Monitoring data (jobs, tags, metrics) uses
UNLOGGEDtables to bypass Write-Ahead Logging (WAL) for 14x faster writes. - FILLFACTOR = 70: Tables are tuned for HOT (Heap Only Tuple) Updates, allowing status transitions (
pending->reserved->completed) to happen entirely in memory. - Asynchronous Commits: The connection is tuned with
synchronous_commit = offfor zero-latency transaction acknowledgement.
composer require emrullahardc/horizon-pgUpdate your .env to use the database queue driver:
QUEUE_CONNECTION=databaseHorizon-PG includes optimized PostgreSQL migrations:
php artisan migratephp artisan horizonTo match Redis performance, Horizon-PG is designed to scale horizontally across CPU cores. It is recommended to run at least 24 processes on modern NVMe drives:
// config/horizon.php
'processes' => 24,The MIT License (MIT). Please see License File for more information.