I’m looking for some data to help me decide which would be the better/faster for communication between two independent processes on Linux:
- TCP
- Named Pipes
Which is worse: the system overhead for the pipes or the tcp stack overhead?
Updated exact requirements:
- only local IPC needed
- will mostly be a lot of short messages
- no cross-platform needed, only Linux
In the past I’ve used local domain sockets for that sort of thing. My library determined whether the other process was local to the system or remote and used TCP/IP for remote communication and local domain sockets for local communication. The nice thing about this technique is that local/remote connections are transparent to the rest of the application.
Local domain sockets use the same mechanism as pipes for communication and don’t have the TCP/IP stack overhead.