Re: unix domain sockets vs. internet sockets

From: Bakul Shah (bakul_at_BitBlocks.com)
Date: 02/25/05

  • Next message: Lister: "ng_fec and cisco 2931"
    To: "Baris Simsek" <simsek@enderunix.org>
    Date: Fri, 25 Feb 2005 07:33:04 -0800
    
    

    > I am coding a daemon program. I am not sure about which type of sockets i
    > should use. Could you compare ip sockets and unix domain sockets? My main
    > criterions are performance and protocol load. What are the differences
    > between impelementations of them at kernel level?

    If you *don't want* remote processes access to your daemon,
    use unix sockets and you don't have to worry about security
    issues as much. This is the main reason for choosing one
    over the other. You should also structure your code so that
    you can change the choice later (as well as use SSL if
    necessary).

    Answering what you didn't ask :-)
    Socket implementation performance differences is the wrong
    thing to worry about this early in the game. Instead of
    trying to make it `as fast as possible', it might make more
    sense to think about what is the expected load (or setting
    load goals) and how to meet the required performance by
    making sure the machine has enough resources and making sure
    you can measure relevant performance parameters at any time.
    How you modularize your daemon, protocol design (if you have
    control over it), available memory, disk speed and data
    organization (if you are accessing lots of data), algorithm
    design, whether you can distribute load across machines etc.
    will have a much bigger influence on overall performance than
    the choice of socket type. You *never* have enough time to
    optimize everything so setting realistic performance goals
    helps you meet them sooner -- you fix the top N bottlenecks
    (which change as you tighten things) and stop when done!
    _______________________________________________
    freebsd-performance@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-performance
    To unsubscribe, send any mail to "freebsd-performance-unsubscribe@freebsd.org"


  • Next message: Lister: "ng_fec and cisco 2931"

    Relevant Pages

    • Re: Socket inheritance: A tale of two vendors
      ... The far simpler workaround is to make darn sure that "daemon" is ... sockets never get inherited and the whole ... Which vendor should I go harass about the problem? ...
      (comp.unix.programmer)
    • Re: Jail to jail network performance?
      ... > Ideally I would like a daemon like socat that can connect/merge two ... > sockets into one, effectively creating a direct connection and ... was able to access both file systems should be able to do a handoff. ...
      (freebsd-stable)
    • Re: passing data to a daemon
      ... > so that the daemon is always running, where its running consists of ... > describes writing a daemon in Python. ... how will I submit jobs to the queue? ... Sockets another. ...
      (comp.lang.python)
    • Re: Multicast Registrierung schlaegt fehl
      ... Allerdings kann's der andere Daemon mit der gleichen lib ja auch... ... der betreffende Part vom oeffnen des Sockets bis zur Registrierung ist hier: ...
      (de.comp.os.unix.programming)
    • Re: How to check UID of process on the other side of local TCP/UDP connection
      ... Isn't it wrong to use the term unix sockets for local ... set of the following transport types: TCPIP, Unix Domain sockets, DEC- ...
      (Focus-Linux)