|
|
Log in / Subscribe / Register

PostgreSQL reconsiders its process-based model

PostgreSQL reconsiders its process-based model

Posted Jun 20, 2023 12:00 UTC (Tue) by rrolls (subscriber, #151126)
Parent article: PostgreSQL reconsiders its process-based model

A process-per-client model makes sense when you have under a thousand connected clients and they're all coming from goodness knows where: i.e. when you definitely don't want any security bugs that expose state from one client to another, or indeed allow one client to (intentionally or otherwise) cause a denial-of-service to another.

But if you have a large number of connections coming from what is essentially the _same_ client, as we often seem to do in web services for even the simple purpose of running multiple queries at the same time, then that really shouldn't be using multiple processes.

A threaded model works, I suppose, but an event-driven model would be far more ideal. Allow each client to connect once, and give each client its own process - but then allow that client to spawn however many asynchronous tasks it wishes and receive the results incrementally, rather than blocking the whole connection for every operation and thus requiring multiple connections. IIRC, IMAP works like this.


The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds