PostgreSQL UNIX domain sockets vs TCP sockets

user20955 picture user20955 · Nov 2, 2008 · Viewed 21.2k times · Source

I wonder if the UNIX domain socket connections with postgresql are faster then tcp connections from localhost in high concurrency rate and if it does, by how much?

Answer

NoelProf picture NoelProf · Aug 24, 2012

Postgres core developer Bruce Momjian has blogged about this topic. Momjian states, "Unix-domain socket communication is measurably faster." He measured query network performance showing that the local domain socket was 33% faster than using the TCP/IP stack.