Forum OpenACS Q&A: Response to Open ACS handling heavy traffic

Collapse
Posted by Stephen van Egmond on
In our experience, the biggest threat to Postgres's scalability is that it uses one process per connection.  It is a big problem if you're using Apache 1.x, and not a big problem if you're using Apache 2.x or AOLServer.

Put simply, each connection gets a process.  So if you have 50 connections hammering away, you have 50 context switches just waiting for attention.  Context switches really, really suck up the time.  In the case of Apache 1.x, each forked process takes up a connection.  So 5 servers times 30 processes equals 150 processes on the db server.  Aaagh.

AOLserver and (supposedly) Apache 2 deal with this with connection pooling. With pgsql it is a humongous deal.

Oracle, MySQL and Sybase don't fork processes for connections.  Sybase in particular uses select() to accept packets all in one thread.  Scary, but very effective.