LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   AF_LOCAL domain socket versus AF_INET socket performance (https://www.linuxquestions.org/questions/linux-general-1/af_local-domain-socket-versus-af_inet-socket-performance-650304/)

zzaappp 06-19-2008 07:50 AM

AF_LOCAL domain socket versus AF_INET socket performance
 
For interprocess communication I've often relied on tcp sockets. For better or worse, they are simple to code, manage, and are pretty fast when you bombard the socket with data. To create these sockets I've used the AF_INET domain parameter passed to the ::socket() function. My form of IPC originally spanned multiple machines, but it has diminished recently to a single box. And thus my need for the full tcp protocol stack has vanished.

I've played around with local sockets before - sockets created using the AF_LOCAL domain rather than AF_INET. They are just as easy to code for as AF_INET domain sockets, and it looks like they would be a good choice for IPC.

But before I do the work, a question remains: If I am sending data across a AF_LOCAL socket, am I letting the kernel off the hook and (thus) removing the tcp protocol stack traversal the kernel would perform for an AF_INET domain socket? In other words, will a AF_LOCAL socket be (significantly?) faster than AF_INET sockets when sending large volumes of data between local processes?


Many thanks!


-z


All times are GMT -5. The time now is 08:34 PM.