--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
Interesting question, where's a benchmark ?
--
Jorge.
Hmm, not necessarily. My experience with unix sockets is that you
don't get the same level of kernel tuning that you do with TCP (listen
backlog, max send/recv buffer size, etc). See this blog that talks
about FastCGI which does use unix/sockets. We ran into all sorts of
bottlenecks.
http://labs.mudynamics.com/2011/03/30/blitzio-the-long-night-before-an-iphone-app-launch/
stdin/stdout will be no-go as well since you are queueing up all of
the messages into a single fd-pair and will result in pipeline stall.
This is similar to using a single HTTP node client to talk to CouchDB,
which ends up queuing up all of the requests. Bad from a concurrency
standpoint.
K.
---
http://blitz.io
http://twitter.com/pcapr
http://labs.mudynamics.com
Full duplex is not the same as concurrent. Each TCP connection is
full-duplex, but in order to achieve concurrency, you need multiple
connections.
> had a look at that article. the problem they were having was because
> they were setting the backlog too small. you would be getting dropped
> packets and connection refused errors just the same if you had done
> the same thing with TCP. i find it hard to believe you could make TCP
> as fast as a unix socket considering TCP has to go through the network
> stack and TCP has all the packet overhead too... W Richard Stevens
> says unix domain sockets are more efficient than network sockets and
> that's usually good enough for me. ;)
>
> Unix domain sockets also allow you to use datagrams rather than
> streams, which might be good depending on what your requirements are.
> The datagrams are reliable and in-order over a unix socket though, not
> like in UDP.
There's a possibility that the datagram unix sockets are faster, but
then you would have to account for the loss of messages in case of
buffer shortage. If you explore sysctl, there isn't much to tune for
unix sockets, but there are a bazillion options for TCP.
does TCP over loopback on linux really not hit the network stack?
doesn't it do packet framing, checksums and protocol handshakes etc? i
can't find any reference to this, so if you have one, please let me
know.