model-writtenrun 2636 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Nathan Bossart reported substantially slower connection establishment since PostgreSQL 16 under workloads creating many parallel workers, especially on large machines with high worker limits, and supplied reproduction steps #1.
- Thomas Munro identified that an already-set latch prevented socket events from being reported and proposed polling the kernel with zero timeout #2; his experimental patch implemented that policy and improved connection times in his local test #4.
- Thomas retained the latch fix and added a companion patch to process PM signals only on latch events, avoiding repeated worker-state scans when multiple events were returned; he argued that every category of postmaster work should receive service within bounded delays #6.
- Nathan reported that both patches substantially improved results, while identifying a separate unresolved performance jump between PostgreSQL 13 and 14 #7; after closer review, he considered both changes reasonable and the latch fix particularly safe, though effects on other PM signals remained a question #8.
- Thomas found that launching up to 100 workers per loop delayed child reaping and artificially exhausted slots; launching one worker produced smoother results but exposed expensive repeated scans, motivating a separate queue-based optimization effort #9.
- Thomas committed the latch portion of #6 as 73f6b9a3b0, with only comment and formatting edits and backports through PostgreSQL 16; he deferred the signal-priority companion because its issue required multiple busy listening sockets and deeper fixes could address the underlying problem #10.
- Thomas submitted three new work-in-progress patches introducing worker-change notifications, direct slot lookup, and scheduling queues that permit starting one worker per loop; PID lookup and free-slot allocation remained additional optimization opportunities #10.
- At the thread’s end, Thomas had paused implementation for other projects and outlined four possible free-slot designs, favoring a circular queue that would preserve postmaster progress despite corrupted shared memory; the worker optimization series and the separate older-version regression remained unresolved #11 #8.