FAQ
Hello

Is there any attempt to use Unix Domain Sockets as the transportation layer
with Thrift?
Isn't it nice to make server and client applications in the same machine
talking with Thrift? Or am I wrong?

Thanks.

Search Discussions

  • Bryan Duxbury at Aug 4, 2010 at 5:04 pm
    I thought the same thing and did some exploration. Ultimately, I determined
    that domain sockets are no better than TCP sockets, even against localhost.
    I recommend you just use TCP.

    -Bryan

    2010/8/4 Bahadır Doğan <abahadirdogan@gmail.com>
    Hello

    Is there any attempt to use Unix Domain Sockets as the transportation layer
    with Thrift?
    Isn't it nice to make server and client applications in the same machine
    talking with Thrift? Or am I wrong?

    Thanks.
  • Rush Manbert at Aug 4, 2010 at 5:51 pm
    I don't want to start a debate, but I beg to differ. Unix domain sockets have a couple of nice features:
    1) They don't offer any way for an outsider to access your service, which is possible if you make a mistake using TCP sockets. The domain sockets don't offer an attack point for a hacker.
    2) There are no port numbers to deal with, which just makes things simpler.

    My Thrift-in-Windows patch (https://issues.apache.org/jira/browse/THRIFT-591) adds an Asio implementation that works for both *nix and Windows (C++ only) and adds Unix Domain Socket support. Caveat emptor, of course, but we're using it in production on Mac OS X and Windows so that local applications can talk to a daemon running as a service.

    - Rush
    On Aug 4, 2010, at 10:04 AM, Bryan Duxbury wrote:

    I thought the same thing and did some exploration. Ultimately, I determined
    that domain sockets are no better than TCP sockets, even against localhost.
    I recommend you just use TCP.

    -Bryan

    2010/8/4 Bahadır Doğan <abahadirdogan@gmail.com>
    Hello

    Is there any attempt to use Unix Domain Sockets as the transportation layer
    with Thrift?
    Isn't it nice to make server and client applications in the same machine
    talking with Thrift? Or am I wrong?

    Thanks.
  • Bryan Duxbury at Aug 4, 2010 at 6:04 pm
    I apologize for being ambiguous in my prior email. I meant to say that unix
    sockets are no *faster* than TCP sockets. You are correct that there are
    other benefits. I'd certainly accept patches for domain sockets if they were
    well done.
    On Wed, Aug 4, 2010 at 10:51 AM, Rush Manbert wrote:

    I don't want to start a debate, but I beg to differ. Unix domain sockets
    have a couple of nice features:
    1) They don't offer any way for an outsider to access your service, which
    is possible if you make a mistake using TCP sockets. The domain sockets
    don't offer an attack point for a hacker.
    2) There are no port numbers to deal with, which just makes things simpler.

    My Thrift-in-Windows patch (
    https://issues.apache.org/jira/browse/THRIFT-591) adds an Asio
    implementation that works for both *nix and Windows (C++ only) and adds Unix
    Domain Socket support. Caveat emptor, of course, but we're using it in
    production on Mac OS X and Windows so that local applications can talk to a
    daemon running as a service.

    - Rush
    On Aug 4, 2010, at 10:04 AM, Bryan Duxbury wrote:

    I thought the same thing and did some exploration. Ultimately, I
    determined
    that domain sockets are no better than TCP sockets, even against
    localhost.
    I recommend you just use TCP.

    -Bryan

    2010/8/4 Bahadır Doğan <abahadirdogan@gmail.com>
    Hello

    Is there any attempt to use Unix Domain Sockets as the transportation
    layer
    with Thrift?
    Isn't it nice to make server and client applications in the same machine
    talking with Thrift? Or am I wrong?

    Thanks.
  • Rush Manbert at Aug 4, 2010 at 6:24 pm
    I certainly agree on that. There's no performance improvement.

    - Rush
    On Aug 4, 2010, at 11:03 AM, Bryan Duxbury wrote:

    I apologize for being ambiguous in my prior email. I meant to say that unix
    sockets are no *faster* than TCP sockets. You are correct that there are
    other benefits. I'd certainly accept patches for domain sockets if they were
    well done.
    On Wed, Aug 4, 2010 at 10:51 AM, Rush Manbert wrote:

    I don't want to start a debate, but I beg to differ. Unix domain sockets
    have a couple of nice features:
    1) They don't offer any way for an outsider to access your service, which
    is possible if you make a mistake using TCP sockets. The domain sockets
    don't offer an attack point for a hacker.
    2) There are no port numbers to deal with, which just makes things simpler.

    My Thrift-in-Windows patch (
    https://issues.apache.org/jira/browse/THRIFT-591) adds an Asio
    implementation that works for both *nix and Windows (C++ only) and adds Unix
    Domain Socket support. Caveat emptor, of course, but we're using it in
    production on Mac OS X and Windows so that local applications can talk to a
    daemon running as a service.

    - Rush
    On Aug 4, 2010, at 10:04 AM, Bryan Duxbury wrote:

    I thought the same thing and did some exploration. Ultimately, I
    determined
    that domain sockets are no better than TCP sockets, even against
    localhost.
    I recommend you just use TCP.

    -Bryan

    2010/8/4 Bahadır Doğan <abahadirdogan@gmail.com>
    Hello

    Is there any attempt to use Unix Domain Sockets as the transportation
    layer
    with Thrift?
    Isn't it nice to make server and client applications in the same machine
    talking with Thrift? Or am I wrong?

    Thanks.
  • Bahadır Doğan at Aug 4, 2010 at 7:09 pm
    I didn't perform a performance test to see which one is faster. But I do not
    understand why domain sockets are not faster. It doesn't enter the
    networking stack, so it should be faster?
    On Wed, Aug 4, 2010 at 9:24 PM, Rush Manbert wrote:

    I certainly agree on that. There's no performance improvement.

    - Rush
    On Aug 4, 2010, at 11:03 AM, Bryan Duxbury wrote:

    I apologize for being ambiguous in my prior email. I meant to say that unix
    sockets are no *faster* than TCP sockets. You are correct that there are
    other benefits. I'd certainly accept patches for domain sockets if they were
    well done.
    On Wed, Aug 4, 2010 at 10:51 AM, Rush Manbert wrote:

    I don't want to start a debate, but I beg to differ. Unix domain sockets
    have a couple of nice features:
    1) They don't offer any way for an outsider to access your service,
    which
    is possible if you make a mistake using TCP sockets. The domain sockets
    don't offer an attack point for a hacker.
    2) There are no port numbers to deal with, which just makes things
    simpler.
    My Thrift-in-Windows patch (
    https://issues.apache.org/jira/browse/THRIFT-591) adds an Asio
    implementation that works for both *nix and Windows (C++ only) and adds
    Unix
    Domain Socket support. Caveat emptor, of course, but we're using it in
    production on Mac OS X and Windows so that local applications can talk
    to a
    daemon running as a service.

    - Rush
    On Aug 4, 2010, at 10:04 AM, Bryan Duxbury wrote:

    I thought the same thing and did some exploration. Ultimately, I
    determined
    that domain sockets are no better than TCP sockets, even against
    localhost.
    I recommend you just use TCP.

    -Bryan

    2010/8/4 Bahadır Doğan <abahadirdogan@gmail.com>
    Hello

    Is there any attempt to use Unix Domain Sockets as the transportation
    layer
    with Thrift?
    Isn't it nice to make server and client applications in the same
    machine
    talking with Thrift? Or am I wrong?

    Thanks.
  • Bryan Duxbury at Aug 4, 2010 at 7:19 pm
    The explanation I got when I looked into it before is that the localhost
    portion of the TCP stack has been crazy optimized, so it's basically no
    worse than domain sockets.

    2010/8/4 Bahadır Doğan <abahadirdogan@gmail.com>
    I didn't perform a performance test to see which one is faster. But I do
    not
    understand why domain sockets are not faster. It doesn't enter the
    networking stack, so it should be faster?
    On Wed, Aug 4, 2010 at 9:24 PM, Rush Manbert wrote:

    I certainly agree on that. There's no performance improvement.

    - Rush
    On Aug 4, 2010, at 11:03 AM, Bryan Duxbury wrote:

    I apologize for being ambiguous in my prior email. I meant to say that unix
    sockets are no *faster* than TCP sockets. You are correct that there
    are
    other benefits. I'd certainly accept patches for domain sockets if they were
    well done.
    On Wed, Aug 4, 2010 at 10:51 AM, Rush Manbert wrote:

    I don't want to start a debate, but I beg to differ. Unix domain
    sockets
    have a couple of nice features:
    1) They don't offer any way for an outsider to access your service,
    which
    is possible if you make a mistake using TCP sockets. The domain
    sockets
    don't offer an attack point for a hacker.
    2) There are no port numbers to deal with, which just makes things
    simpler.
    My Thrift-in-Windows patch (
    https://issues.apache.org/jira/browse/THRIFT-591) adds an Asio
    implementation that works for both *nix and Windows (C++ only) and
    adds
    Unix
    Domain Socket support. Caveat emptor, of course, but we're using it in
    production on Mac OS X and Windows so that local applications can talk
    to a
    daemon running as a service.

    - Rush
    On Aug 4, 2010, at 10:04 AM, Bryan Duxbury wrote:

    I thought the same thing and did some exploration. Ultimately, I
    determined
    that domain sockets are no better than TCP sockets, even against
    localhost.
    I recommend you just use TCP.

    -Bryan

    2010/8/4 Bahadır Doğan <abahadirdogan@gmail.com>
    Hello

    Is there any attempt to use Unix Domain Sockets as the
    transportation
    layer
    with Thrift?
    Isn't it nice to make server and client applications in the same
    machine
    talking with Thrift? Or am I wrong?

    Thanks.
  • Bahadır Doğan at Aug 4, 2010 at 7:36 pm
    Thanks!
    On Wed, Aug 4, 2010 at 10:18 PM, Bryan Duxbury wrote:

    The explanation I got when I looked into it before is that the localhost
    portion of the TCP stack has been crazy optimized, so it's basically no
    worse than domain sockets.

    2010/8/4 Bahadır Doğan <abahadirdogan@gmail.com>
    I didn't perform a performance test to see which one is faster. But I do
    not
    understand why domain sockets are not faster. It doesn't enter the
    networking stack, so it should be faster?
    On Wed, Aug 4, 2010 at 9:24 PM, Rush Manbert wrote:

    I certainly agree on that. There's no performance improvement.

    - Rush
    On Aug 4, 2010, at 11:03 AM, Bryan Duxbury wrote:

    I apologize for being ambiguous in my prior email. I meant to say
    that
    unix
    sockets are no *faster* than TCP sockets. You are correct that there
    are
    other benefits. I'd certainly accept patches for domain sockets if
    they
    were
    well done.

    On Wed, Aug 4, 2010 at 10:51 AM, Rush Manbert <rush@manbert.com>
    wrote:
    I don't want to start a debate, but I beg to differ. Unix domain
    sockets
    have a couple of nice features:
    1) They don't offer any way for an outsider to access your service,
    which
    is possible if you make a mistake using TCP sockets. The domain
    sockets
    don't offer an attack point for a hacker.
    2) There are no port numbers to deal with, which just makes things
    simpler.
    My Thrift-in-Windows patch (
    https://issues.apache.org/jira/browse/THRIFT-591) adds an Asio
    implementation that works for both *nix and Windows (C++ only) and
    adds
    Unix
    Domain Socket support. Caveat emptor, of course, but we're using it
    in
    production on Mac OS X and Windows so that local applications can
    talk
    to a
    daemon running as a service.

    - Rush
    On Aug 4, 2010, at 10:04 AM, Bryan Duxbury wrote:

    I thought the same thing and did some exploration. Ultimately, I
    determined
    that domain sockets are no better than TCP sockets, even against
    localhost.
    I recommend you just use TCP.

    -Bryan

    2010/8/4 Bahadır Doğan <abahadirdogan@gmail.com>
    Hello

    Is there any attempt to use Unix Domain Sockets as the
    transportation
    layer
    with Thrift?
    Isn't it nice to make server and client applications in the same
    machine
    talking with Thrift? Or am I wrong?

    Thanks.
  • Richard Salz at Aug 4, 2010 at 7:36 pm

    The explanation I got when I looked into it before is that the localhost
    portion of the TCP stack has been crazy optimized, so it's basically no
    worse than domain sockets.
    Yes, it's often as simple as a memory-to-memory copy.

    /r$
  • Dieter Plaetinck at Aug 5, 2010 at 9:05 am

    On Wed, 4 Aug 2010 12:18:42 -0700 Bryan Duxbury wrote:

    The explanation I got when I looked into it before is that the
    localhost portion of the TCP stack has been crazy optimized, so it's
    basically no worse than domain sockets.
    Does this also apply to non-127.0.0.1 ip's which are on the local host?
    (like 192.168.0.1 or even a public ip?)

    Anyway, some reading material suggests that unix domain sockets *are*
    (somewhat) faster. Ie:
    http://petewarden.typepad.com/searchbrowser/2009/11/realworld-benchmarking-of-keyvalue-stores.html
    http://osnet.cs.binghamton.edu/publications/TR-20070820.pdf

    .. but I still need to check the details.

    Dieter
  • Bryan Duxbury at Aug 5, 2010 at 4:49 pm
    Sorry, but I don't have really solid details to back up my assertions. I
    wish I'd had the sense to write a blog post about it at the time.
    On Wed, Aug 4, 2010 at 12:37 PM, Dieter Plaetinck wrote:

    On Wed, 4 Aug 2010 12:18:42 -0700
    Bryan Duxbury wrote:
    The explanation I got when I looked into it before is that the
    localhost portion of the TCP stack has been crazy optimized, so it's
    basically no worse than domain sockets.
    Does this also apply to non-127.0.0.1 ip's which are on the local host?
    (like 192.168.0.1 or even a public ip?)

    Anyway, some reading material suggests that unix domain sockets *are*
    (somewhat) faster. Ie:

    http://petewarden.typepad.com/searchbrowser/2009/11/realworld-benchmarking-of-keyvalue-stores.html
    http://osnet.cs.binghamton.edu/publications/TR-20070820.pdf

    .. but I still need to check the details.

    Dieter
  • Rush Manbert at Aug 5, 2010 at 5:32 pm
    If anyone's super interested in this, you can use the THRIFT-591 patch on Windows or *nix. The full build runs the stress-test in all the possible server and socket configurations, so you can look at relative performance that way.

    - Rush
    On Aug 5, 2010, at 9:49 AM, Bryan Duxbury wrote:

    Sorry, but I don't have really solid details to back up my assertions. I
    wish I'd had the sense to write a blog post about it at the time.
    On Wed, Aug 4, 2010 at 12:37 PM, Dieter Plaetinck wrote:

    On Wed, 4 Aug 2010 12:18:42 -0700
    Bryan Duxbury wrote:
    The explanation I got when I looked into it before is that the
    localhost portion of the TCP stack has been crazy optimized, so it's
    basically no worse than domain sockets.
    Does this also apply to non-127.0.0.1 ip's which are on the local host?
    (like 192.168.0.1 or even a public ip?)

    Anyway, some reading material suggests that unix domain sockets *are*
    (somewhat) faster. Ie:

    http://petewarden.typepad.com/searchbrowser/2009/11/realworld-benchmarking-of-keyvalue-stores.html
    http://osnet.cs.binghamton.edu/publications/TR-20070820.pdf

    .. but I still need to check the details.

    Dieter

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriesthrift
postedAug 4, '10 at 8:56a
activeAug 5, '10 at 5:32p
posts12
users5
websitethrift.apache.org
irc#thrift

People

Translate

site design / logo © 2022 Grokbase