Tom Lane <tgl@sss.pgh.pa.us> writes:
> Doug McNaught <doug@wireboard.com> writes:
> > For a localhost TCP socket, a write() has to be sent down the network
> > stack and (possibly) split into packets, which are then sent through
> > the routing engine and back up through the stack, flow-controlled,
> > reassembled, and submitted to the receiving socket. Also, ACK packets
> > have to be sent back to the sender through the same tortuous path.
>
> My notion of a "properly designed" kernel is one that has a shortcircuit
> path for local TCP connections, to avoid precisely that overhead. Not
> all do ... but any kernel wherein attention has been paid to X Windows
> performance (to mention just one important case) does.
Hmmm. I would take issue with your notion of "properly designed"--one
might instead use the phrase "insanely bloated with special cases". ;)
X can, and should, use Unix sockets and/or shared memory for speed
when connecting to the local display.
I don't intend to start a flamewar--I just think "properly designed"
is a matter of philosophy.
> Of course, since the kernel is certainly capable of net socket
> throughput well in excess of 0.3 megabytes/sec on this machine, this
> example really just proves Doug's other point: the difference between a
> Unix socket and a TCP socket is unlikely to be important for Postgres
> purposes, because it'll be swamped by other factors.
Yeah, I think that was my main point, though I didn't really emphasize
it very well.
Thanks for the followup.
-Doug