Dev-iL commented on code in PR #67800:
URL: https://github.com/apache/airflow/pull/67800#discussion_r3369000609


##########
airflow-core/docs/howto/set-up-database.rst:
##########
@@ -233,6 +233,13 @@ For more information regarding setup of the PostgreSQL 
connection, see `PostgreS
 
    See also :ref:`Helm Chart production guide <production-guide:pgbouncer>`
 
+   Some Airflow database routes use an async engine (the Execution API, for 
example). The asyncpg

Review Comment:
   Switched the docs to `statement_cache_size=0` + 
`prepared_statement_cache_size=0`, both in `connect_args`. This is because the 
dialect pops the latter before `connect()`, so no need to split it into the 
URL. Verified on breeze/PG14: default leaves 6 `__asyncpg_stmt__` entries on 
the backend, the recipe leaves 0. Defaulting to psycopg3 is tracked in #67801.
   
   ---
   
   Regarding the translatability of the benchmark results to practice:
   - The big gap in the benchmark is mostly an artifact of the tight localhost 
loop: back-to-back queries w/o a network hop - so it isolates driver overhead. 
   - The benchmark mixes concurrency models: async drivers run as coroutines on 
one event loop, sync ones via a thread pool, so the sync-vs-async rows aren't 
directly comparable. asyncpg vs psycopg3-async (both async, dedicated 
connection each) is the clean comparison, and the one that matters for choosing 
the default.
   - In real Airflow it largely won't translate: one query per request behind a 
network/PgBouncer hop, where the round-trip dominates and the driver delta is a 
small fraction.
   
   Either way it's moot if we pick psycopg3 on pgbouncer-safety rather than 
throughput.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to