Skip site navigation (1) Skip section navigation (2)

Re: Performance: Unix sockets vs. TCP/IP sockets

From: Adrian Phillips <adrianp(at)powertech(dot)no>
To: Frank Joerdens <frank(at)joerdens(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Performance: Unix sockets vs. TCP/IP sockets
Date: 2001-01-26 16:58:56
Message-ID: 87wvbi8d2n.fsf@grannyogg.localnet (view raw, whole thread or download thread mbox)
Lists: pgsql-general
>>>>> "Frank" == Frank Joerdens <frank(at)joerdens(dot)de> writes:

    Frank> On Thu, Jan 25, 2001 at 11:07:19PM -0500, Tom Lane wrote:
    >> Frank Joerdens <frank(at)joerdens(dot)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:


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


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,


Adrian Phillips

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

In response to

pgsql-general by date

Next:From: Doug McNaughtDate: 2001-01-26 17:04:27
Subject: Re: Performance: Unix sockets vs. TCP/IP sockets
Previous:From: Oliver ElphickDate: 2001-01-26 16:44:41
Subject: Re: Problem with inheritance

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group