On Tue, 2005-18-10 at 22:21 -0500, Tony Caduto wrote:
> From what i understand Postgresql will scale with more cpus, but not in
> the same way as threaded server would.
Threading isn't really relevant. PostgreSQL currently forks a new
process for each client connection, and each process can be scheduled on
a different CPU. If PostgreSQL used threads and allocated one thread per
client connection, each thread could be scheduled on a different CPU
(assuming we used kernel threads). So either way the number of
concurrent connections would need to exceed the number of CPUs to scale
effectively.
Now, rather than dedicating a single process/thread to each connection,
another approach would be to share the work of query processing among
threads/processes differently. For example, we could perform a large
sort operation by splitting the input data among N threads/processes,
which could then do the sort in parallel. Postgres currently doesn't do
this, but it doesn't have much to do with threads vs. processes per se
(threads might make this somewhat easier to implement, though).
-Neil