Hi Per, On Thu, 15 Jun 2006, 20:30:59 +0200, Per Jessen wrote:
Manfred Hollstein wrote:
As Curt pointed out, UNIX sockets can only be used if you are sure, communication will only be on the local machine. But performance will actually *really* benefit if you're using UNIX vs INET sockets:
Manfred,
thanks, that was quite helpful. The daemon I'm writing/using will be supporting UNIX and INET sockets (doing both is no big deal), but in some situations both client and server will be on the same machine, and I was wondering about the performance.
UNIX sockets on local machine: $ ./lclient dummy MBytes per sec. : 262.23 MBytes per sec. : 284.34 MBytes per sec. : 293.61 MBytes per sec. : 307.26 MBytes per sec. : 355.33
INET sockets between two machines connected via GigE: $ ./gclient saturn MBytes per sec. : 99.18 MBytes per sec. : 94.13 MBytes per sec. : 102.68 MBytes per sec. : 103.58 MBytes per sec. : 103.69 MBytes per sec. : 97.92 MBytes per sec. : 103.15
You wouldn't happen to also have some numbers for "INET sockets on local machine"?
Good catch! Appears that the Linux TCP stack is dealing *very well* with local INET sockets: $ ./gclient localhost MBytes per sec. : 769.15 MBytes per sec. : 736.10 MBytes per sec. : 693.76 MBytes per sec. : 704.09 MBytes per sec. : 666.63 $ ./gclient saturn MBytes per sec. : 720.64 MBytes per sec. : 731.70 MBytes per sec. : 659.83 MBytes per sec. : 741.61 MBytes per sec. : 716.62 localhost and saturn are the same physical machine. Hmm, zero-copying at its best. This means, you're always better using INET sockets; now, that's new to me... I remember running the same test on several Sun machines (SunOS 4.1.4, Solaris 2.6) years ago, and the results were clearly punishing users of INET sockets on local machines... Linux rules D) Cheers. l8er manfred