Re: Multiple UNIX-domain sockets? - Mailing list pgsql-novice

From Oliver Fromme
Subject Re: Multiple UNIX-domain sockets?
Date
Msg-id 200609261315.k8QDFRdq048973@lurza.secnetix.de
Whole thread Raw
In response to Re: Multiple UNIX-domain sockets?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Tom Lane wrote:
 > Oliver Fromme writes:
 > > The only solution would be to use TCP sockets on localhost,
 > > but the TCP/IP overhead is considerably higher, especially
 > > when there are lots of small queries (which I expect).
 > > I've foiund several benchmarks in various mailinglists,
 > > some mention a factor of 10.
 >
 > Really?  A decently designed TCP stack should have enough shortcuts
 > for local traffic to be competitive with Unix sockets.

TCP/IP is a very non-trivial protocol.  It has to deal with
fragmentation, re-assembly, retransmission and reordering,
calculating and verifying checksums, transmission window
control, packet filtering etc., and all of that includes
connections to localhost, too.

Compared to that, UNIX domain sockets are extremely simple.

 > Have you
 > measured a significant performance problem for yourself?

I have to admit that I haven't done any benchmarks myself.
The problem is that it's not easy (and takes much time) to
set up such benchmarks under realistic conditions and get
useful numbers.  I've found the following postings:

http://freebsd.rambler.ru/bsdmail/freebsd-stable_2005/msg07530.html
http://freebsd.rambler.ru/bsdmail/freebsd-stable_2005/msg07442.html

They don't relate to PostgreSQL, though, but to other apps
that can use TCP sockets and UNIX sockets.

Best regards
   Oliver

--
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"Python is an experiment in how much freedom programmers need.
Too much freedom and nobody can read another's code; too little
and expressiveness is endangered."
        -- Guido van Rossum

pgsql-novice by date:

Previous
From: Sean Davis
Date:
Subject: Re: Access to PostgreSQL database from external world
Next
From: Michael Fuhr
Date:
Subject: Re: pass date type data to PQexecparams