Re: Multiple UNIX-domain sockets?

From: Oliver Fromme <olli(at)lurza(dot)secnetix(dot)de>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane)
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Multiple UNIX-domain sockets?
Date: 2006-09-26 13:15:27
Message-ID: 200609261315.k8QDFRdq048973@lurza.secnetix.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2006-09-26 14:35:30 Re: pass date type data to PQexecparams
Previous Message Sean Davis 2006-09-26 10:38:30 Re: Access to PostgreSQL database from external world