Replies: 2 comments
|
A couple of technical specifics that may help pinpoint this:
I can't see the managed Auth service's internal logs — that's where my visibility ends. Could someone on the Neon side check the Auth service logs for this project ( |
|
This is The reason it defeats Scale-to-Zero is exactly what you noticed: Immediate mitigation (no downtime) Pin your app to pnpm add @neondatabase/auth@0.1.0-beta.19Or, if you need to stay on the current beta for other reasons, there's an undocumented env that short-circuits the introspection: NEON_AUTH_DISABLE_INTROSPECTION=1I confirmed this by reading the beta.21 bundle — the check is behind Structural fix (recommended if you keep neon_auth long-term) Move
Now Verify the mitigation worked SELECT usename, count(*) AS sessions,
max(now() - query_start) AS oldest_query_age
FROM pg_stat_activity
WHERE usename = 'neon_auth'
GROUP BY 1;Before the fix you'll see Track the upstream fix The debounce pattern that landed for pgbouncer keepalives is what needs to be ported to the auth introspection loop. The fix is small (~20 lines around the setInterval that runs the drift check) — worth pinging the Neon Auth team on |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Our production compute never scales to zero despite a 300s suspend setting and very low traffic — it has been continuously active for 30h+. After investigation, the sole cause is the Neon Auth managed service running a near-constant schema-introspection loop against the compute. This silently disables Scale to Zero and inflates compute-hour billing.
Project:
sparkling-river-28733703· Region:aws-eu-west-2· Compute:ep-shiny-fire-ab9o4lxg(primary, RW) · SDK:@neondatabase/auth@0.1.0-beta.21Evidence
1.
neon_authpolls the schema ~2×/second, continuously. Samplingpg_stat_activity(438 samples @ 400ms over 3 min), the DB roleneon_authruns this query in 332/438 samples:It also periodically reads
neon_auth.project_configand runsSHOW search_path. The max idle gap betweenneon_authqueries was ~169s — always under the 300s suspend threshold, so the compute never sleeps.2. Our application is not the cause. During the same window our app role (
neondb_owner) issued zero application queries — we use the statelessneon-httpdriver and cache aggressively. The recurring activity is entirely fromneon_auth.3. Definitive test — application fully offline. As a final check we took our Railway application deployment completely offline for 2.5 minutes and kept sampling.
neon_authwas still introspecting the schema in 75 of 75 samples. The managed Auth service polls independently of any client/app activity.4. Contrast. A branch in the same project without Neon Auth (
ep-steep-union-abxpm1uf) suspends normally after 5 min idle.Impact
Enabling Neon Auth effectively disables Scale to Zero on the primary compute and bills it as always-on, with no documented setting to control it.
This is not a client-SDK issue
To pre-empt the obvious suggestion: upgrading the SDK is not the fix, and we want to be clear this is a server-side bug rather than a client misconfiguration. The polling is performed server-side by the
neon_authrole and continued unchanged with our application fully offline (Evidence #3). We're on@neondatabase/auth@0.1.0-beta.21and aware the latest is0.4.1-beta— but a client-SDK version cannot change managed-service behavior, andinformation_schema.tablesis a schema/migration query, not per-request session validation. So this is a bug in the managed Auth service, not something to patch around client-side.Questions
information_schema.tablespolling (~2×/sec) expected, or a bug in the managed Auth service? Re-introspecting the schema twice a second seems unintended.Raw
pg_stat_activitycaptures (methodology + output)Method: poll
pg_stat_activity(filterbackend_type='client backend') at a fixed interval, excluding Neon's internalcloud_adminbackends and our own sampling query. Times are UTC.A — A single
neon_authbackend (steady state):B — High-frequency sample, 438 polls @ 400ms over 3 min (normal traffic):
neon_authwas the active/last query on a backend in 332 of 438 samples (~75% of the time).C — 8-min timeline (normal traffic), non-internal query executions:
D — Application OFFLINE for 2.5 min (Railway deployment removed), 75 polls @ 2s:
(The only other role observed during this window,
neondb_owner, was our ownpg_stat_activitysampling query — not the application, which was offline.)Thanks for taking a look.
All reactions