0

I'm trying to understand how fast different IPC mechanisms are, and I know it's possible to create a Unix Socket as a "file" in a directory on a filesystem, but what I don't understand is whether data piped through that socket actually touches disk, or if it's stored in memory, or if it is somehow communicated directly from the sending process to the receiving process. And where does the data in the buffer live if there isn't a consumer immediately available?

  • https://tldp.org/LDP/intro-linux/html/sect_03_01.html *"socket: a special file type, similar to TCP/IP sockets, providing inter-process networking protected by the file system's access control."* - nothing gets written to disk – HBruijn Aug 19 '22 at 12:53

1 Answers1

1

It's googled easly:

https://www.howtogeek.com/devops/what-are-unix-sockets-and-how-do-they-work/

Despite creating files on disk, Unix sockets don’t actually write the data they send to the disk, as that would be far too slow. Instead, all the data is retained within kernel memory; the only point of the socket file is to maintain a reference to the socket, and to give it filesystem permissions to control access.

gapsf
  • 641
  • 1
  • 5
  • 12