3 ms·
> I am almost positive it is being done with some form of non blocking sockets. Database libraries in Python that support this (as opposed to blocking, synchro
by pdonis 6y ago
> I am almost positive it is being done with some form of non blocking sockets.
Database libraries in Python that support this (as opposed to blocking, synchronous sockets, which are of course common) are pretty thin on the ground. That's why I would have liked to see more details in the article about exactly how the benchmark was doing the database queries.
> There is no "direct library calls" as the database server exists as a separate process to the server process.
Yes, you're right, I wasn't being very clear. The key question is, as above, whether nonblocking sockets are being used or not.
- zzzeek 6y agothe psycopg2 driver for PostgreSQL supports an async mode which uses PostgreSQL's full blown non-blocking API, this is what I used when I did my tests and might be what was used here. There is also the asyncpg driver that is native to PG's non-blocking API. PG is the one database that does lend itself to async because it has a fully non-blocking client library available. https://www.postgresql.org/docs/12/libpq-async.html https://www.postgresql.org/docs/12/libpq-async.html https://www.psycopg.org/docs/advanced.html#green-support https://www.psycopg.org/docs/advanced.html#green-support https://github.com/MagicStack/asyncpg https://github.com/MagicStack/asyncpg