Re: Performance: Unix sockets vs. TCP/IP sockets - Mailing list pgsql-general

From Adrian Phillips
Subject Re: Performance: Unix sockets vs. TCP/IP sockets
Date
Msg-id 87wvbi8d2n.fsf@grannyogg.localnet
Whole thread Raw
In response to Performance: Unix sockets vs. TCP/IP sockets  (Frank Joerdens <frank@joerdens.de>)
List pgsql-general
>>>>> "Frank" == Frank Joerdens <frank@joerdens.de> writes:

    Frank> On Thu, Jan 25, 2001 at 11:07:19PM -0500, Tom Lane wrote:
    >> Frank Joerdens <frank@joerdens.de> writes: > What performance
    >> penalty can I expect when going over TCP/IP sockets > instead
    >> of Unix sockets?
    >>
    >> On a properly designed kernel, there shouldn't be any
    >> measurable performance difference between a local TCP
    >> connection and a Unix-socket connection.

    Frank> Ah. That's good hear. I'd heard that TCP/IP was
    Frank> _significantly_ slower than Unix sockets. But maybe that
    Frank> was just Linux.

I must admit from my mysql days that this comment was made, but we are
probably talking a couple of years ago, which would be Linux
2.0. Whether 2.2 was better, or 2.4 is I am completely clueless. Here
is an excerpt from the mysql manual (heres hoping I won't be lynched
for posting this :-) :-

    You get the fastest executable when you link with -static. Using
    Unix sockets rather than TCP/IP to connect to a database also
    gives better performance.

and :-

    Here is a list of some mesurements that we have done:

<snip>

    If you connect using TCP/IP rather than Unix sockets, the result
    is 7.5% slower.

<snip>

I searched on google for references to this, plenty of mysql hits, but
also other systems, for example Cold Fusion has this to say :-

    In our testing, the use of the newly implemented TCP Network
    socket communication will degrade performance by 10-15% or more
    from the default Unix Domain socket

(although this may be because of Cold Fusion itself).

I must admit most of the other references to slower TCP than Unix
sockets are to older documents. I suppose the easiest thing to do is
setup a test and see for yourself.

Sorry if this is becoming to OT,

Sincerely,

Adrian Phillips

--
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now?  [OK]

pgsql-general by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Re: Problem with inheritance
Next
From: Doug McNaught
Date:
Subject: Re: Performance: Unix sockets vs. TCP/IP sockets