- 1-2 seconds end-to-end latency via 1-second pg_cron ticks.
- Microsecond per-call latencies for send, receive, ack.
- Proven PgQ architecture from Skype, 2007-2017+.
Nikolay Samokhvalov released PgQue on October 10, 2024, via GitHub. The project reimplements Skype's PgQ queue in pure PL/pgSQL for Postgres 14 and later. Core functions—send, receive, ack—run in the microsecond range, per the repository README.
PgQue uses pg_cron to call pgque.ticker() every second. End-to-end delivery latency measures 1-2 seconds under default settings. This includes up to 1 second for the next tick and consumer poll interval.
Skype developed PgQ in 2007 for production queues serving hundreds of millions of users. The system operated on self-managed Postgres clusters for over 10 years.
Core Architecture from Skype PgQ
Skype engineers built PgQ to handle high-volume tasks without external dependencies. Nikolay Samokhvalov preserved this logic in PgQue, eliminating non-essential features.
Users install PgQue via SQL scripts on Postgres 14+. The pg_cron extension, available on Amazon RDS, schedules ticks. See the PgQue GitHub repository.
Heroku reported a 60,000-job backlog in one hour in 2015, per developer Brandur Lech. PgQue's design avoids such overloads through simple state advancement.
Latency Metrics
PgQue's per-call latencies for send, receive, and ack fall in the microsecond range. The ticker bounds maximum wait to 1 second.
End-to-end latency totals 1-2 seconds. Top-priority tasks dispatch in single-digit milliseconds.
- Metric: Per-call latency · Value: Microseconds
- Metric: End-to-end delivery · Value: 1-2 seconds
- Metric: Ticker interval · Value: 1 second
- Metric: Max next-tick wait · Value: 1 second
- Metric: Top-priority dispatch · Value: Single-digit ms
Metrics from PgQue GitHub README, October 10, 2024.
Compatibility with Managed Postgres
Amazon RDS supports PgQue with pg_cron on Postgres 14+. No additional extensions required. The pg_cron GitHub confirms compatibility.
PlanetScale documented a queue overload at 800 jobs per second in 2024. PgQue targets transactional Postgres to sidestep OLAP-style failures.
Developers deploy from Postgres 14 PL/pgSQL docs.
Advantages Over External Queues
PgQue runs inside Postgres, skipping network calls to Redis or RabbitMQ. Developers leverage existing Postgres skills.
Over 10 years of PgQ runtime at Skype validate the approach. Ticker frequency tunes to workload needs.
Future pg_cron updates may improve tick precision. PgQue suits fintech task queues requiring low latency without added infrastructure.
Frequently Asked Questions
What is PgQue?
PgQue reimplements Skype's PgQ queue in pure PL/pgSQL for Postgres 14+, per Nikolay Samokhvalov's GitHub repository released October 10, 2024. It uses pg_cron for 1-second ticks.
What latencies does PgQue achieve?
Per-call operations run in microseconds. End-to-end delivery takes 1-2 seconds, with top-priority dispatches in single-digit milliseconds, per repository specs.
How does PgQue connect to Skype's PgQ?
Skype built PgQ in 2007 for hundreds of millions of users on Postgres. PgQue preserves core logic without bloat.
Does RDS support PgQue?
Yes, Amazon RDS runs PgQue with pg_cron on Postgres 14+. No custom extensions needed.



