UNIX domain sockets vs TCP sockets

UNIX domain sockets vs TCP sockets

Post by Wael Elwasi » Wed, 10 Mar 1999 04:00:00



Hello all,
 In R. Stevens's Unix Network Programming, second edition Vol. 1 he
states that "On Berkeley-derived implementations Unix domain sockets are
often twice as fast as a TCP socket". Now my question is has anybody
looked into whether this statement is true on non-Berkely
implementations, particularly Solaris?

  I did some testing on my own on Solaris 2.5 and was surprised to see
that unix domain sockets actually performed worse than TCP sockets (when
the client and server reside on the same box). For my test code I found
TCP sockets to be approximately 38% faster than unix domain sockets.

  Now if this conclusion is correct, why would that be the case?. And if
it's wrong, then has anybody studied this issue in some detail?.

Thanx
--
---------------------------
Wael R. Elwasif
Computer Science Department
University of Tennessee, Knoxville
Phone : (423) 974-6852
Fax   : (423) 974-4404

 
 
 

1. Performance of INET- vs UNIX-domain sockets ???

Hello,

I am currently running Solaris 2.5.1 on a SUN SPARCStation 10/30 and intended
to perform some performance tests with Internet and Unix domain sockets. I was
quite surprized to see that INET Sockets delivered better performances than
UNIX Sockets !!!

Context:
- 2 processes, client and server on a single machine, that exchange data at
        a saturated rate (from client to server).
- For INET, both machine name and "localhost" were used for the connect with
        no significant change.
- Constant packet sizes, namely 1, 4, 8 and 32 KBytes.

Results: Measured throughput in Mbps
        Packet Size:            1KByte  4KByte  8KByte  32KByte
        -------------------------------------------------------
        INET-Socket             16      38      45      52
        UNIX-Socket             14      33      38      49

Can anybody interprete these figures ? Is it due to the relatively large
packet size ? (with packets of very small size, UNIX delivers slighter
better performances that INET, approx. 7%).

Thanks for any hint !
Christian

--

 ---------------------------     % % % % %     ---------------------------
                                        %
 Christian CONRAD                      %            
                                      %        Tel. (+41) 1 / 632 7015      
 ETH-Zurich                          %         Fax  (+41) 1 / 632 1035        

   Kommunikationsnetze (TIK)       %      
                                  %        
----------------------------     % % % % %     ---------------------------

2. Apache 1.3 feature request...

3. Unix Domain Sockets (Solaris 7 vs 2.5.1)

4. GCC-UPgraDe-GuiDE

5. shutdown(s, 2) vs close(s) for closing unix domain sockets

6. COMMERCIAL: Red Hat's TriTeal CDE for Linux

7. system V IPCs vs. unix domain socket

8. 3 button mice

9. HELP: Internet Vs Unix Domain Sockets

10. Problem with Unix Domain sockets on OSF Unix V4.0

11. x.25 socket and tcp/ip socket