pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wei Weng <wweng@kencast.com>
To: pgsql-interfaces@postgresql.org
Subject: concurrent connections is worse than serialization?
Date: 13 Aug 2002 17:51:10 -0400
Message-ID: <1029275471.16828.9.camel@Monet> (raw)

I have a testing program that uses 30 concurrent connections
(max_connections = 32 in my postgresql.conf) and each does 100
insertions to a simple table with index.

It took me approximately 2 minutes to finish all of them.

But under the same environment(after "delete From test_table, and vacuum
analyze"), I then queue up all those 30 connections one after another
one (serialize) and it took only 30 seconds to finish.

Why is it that the performance of concurrent connections is worse than
serializing them into one?

I was testing them using our own (proprietary) scripting engine and the
extension library that supports postgresql serializes the queries by
simply locking when a query manipulates a PGconn object and unlocking
when it is done. (And similiarly, it creates a PGconn object on the
stack for each concurrent queries.)

Thanks

-- 
Wei Weng
Network Software Engineer
KenCast Inc.





Message-ID: <1029275471.16828.9.camel@Monet>
Permalink:  ../1029275471.16828.9.camel@Monet/
Also on:    postgresql.org/message-id/1029275471.16828.9.camel@Monet

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: wweng@kencast.com
  Subject: Re: concurrent connections is worse than serialization?
  In-Reply-To: <1029275471.16828.9.camel@Monet>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox