Compiler-Hidden PostgreSQL Continuations for Direct-Style Server Programs

This paper presents Gray's compiler-hidden PostgreSQL continuation architecture, which preserves direct source-order database calls while moving connection and query waiting onto readiness-driven runtime state machines. The work responds to a retained one-hour baseline that delivered 3,999.85 requests per second at 4,000 requested but accumulated 802.82 ms corrected p99. The replacement path uses nonblocking libpq connection establishment, parameterized query dispatch, output flushing, input consumption, result draining, cancellation, and connection retirement under a normalized readiness reactor. A rate curve placed the new useful corrected-latency knee between 12,000 and 16,000 requested requests per second. A separate Static qualification with PostgreSQL 16, a 64-connection pool, four wrk2 threads, and 256 persistent HTTP connections delivered 7,961.48/s at 8,000 requested with 1.43 ms corrected p50, 4.60 ms p99, and 8.74 ms p99.9. During load, the runtime exposed as many as 164 simultaneously suspended handlers while using zero general task workers; after completion, active task, worker, and continuation counts returned to zero. Semantic gates covered overlapping queries with one configured task worker, typed errors after resumption, HTTP/2 multiplexing, cancellation and connection replacement, 404/500 behavior, and Adaptive deployment replacement. The result demonstrates that direct-style server code and readiness-driven database concurrency can coexist as one compiler-runtime contract without requiring application-authored polling logic or a worker per blocked handler.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-07-26
DOI
https://doi.org/10.5281/zenodo.21633225
Primary Topic
Cloud Computing and Resource Management
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Compiler-Hidden PostgreSQL Continuations for Direct-Style Server Programs

Annabella Proctor
Zenodo (CERN European Organization for Nuclear Research)
Cloud Computing and Resource Management
preprint

Compiler-Hidden PostgreSQL Continuations for Direct-Style Server Programs

Annabella Proctor
preprint en

Abstract

This paper presents Gray's compiler-hidden PostgreSQL continuation architecture, which preserves direct source-order database calls while moving connection and query waiting onto readiness-driven runtime state machines. The work responds to a retained one-hour baseline that delivered 3,999.85 requests per second at 4,000 requested but accumulated 802.82 ms corrected p99. The replacement path uses nonblocking libpq connection establishment, parameterized query dispatch, output flushing, input consumption, result draining, cancellation, and connection retirement under a normalized readiness reactor. A rate curve placed the new useful corrected-latency knee between 12,000 and 16,000 requested requests per second. A separate Static qualification with PostgreSQL 16, a 64-connection pool, four wrk2 threads, and 256 persistent HTTP connections delivered 7,961.48/s at 8,000 requested with 1.43 ms corrected p50, 4.60 ms p99, and 8.74 ms p99.9. During load, the runtime exposed as many as 164 simultaneously suspended handlers while using zero general task workers; after completion, active task, worker, and continuation counts returned to zero. Semantic gates covered overlapping queries with one configured task worker, typed errors after resumption, HTTP/2 multiplexing, cancellation and connection replacement, 404/500 behavior, and Adaptive deployment replacement. The result demonstrates that direct-style server code and readiness-driven database concurrency can coexist as one compiler-runtime contract without requiring application-authored polling logic or a worker per blocked handler.

Zenodo (CERN European Organization for Nuclear Research)
Skyworth (China) (CN)
Cloud Computing and Resource Management
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.