Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

AF_LOCAL socket versus AF_INET socket performance [SOLVED]

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
zzaappp
Apprentice
Apprentice
User avatar
Posts: 176
Joined: Fri Jun 06, 2003 11:26 am

AF_LOCAL socket versus AF_INET socket performance [SOLVED]

  • Quote

Post by zzaappp » Wed Jun 18, 2008 10:23 pm

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 (UNIX sockets)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 (a little bit) 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
Last edited by zzaappp on Sun Jun 29, 2008 1:37 am, edited 3 times in total.
Top
zzaappp
Apprentice
Apprentice
User avatar
Posts: 176
Joined: Fri Jun 06, 2003 11:26 am

  • Quote

Post by zzaappp » Sun Jun 29, 2008 1:29 am

I decided to dive into this myself, especially when I found the Interactive Linux Kernel Map:
http://www.makelinux.net/kernel_map

This examination eventually let to:
http://en.wikipedia.org/wiki/Unix_domain_sockets

This lead to a discussion which seems to address my original question:
http://lists.freebsd.org/pipermail/free ... 01143.html

So for IPC on a local machine, it appears UNIX domain sockets are better performers.

Eventually I will do a follow up with metric performance comparison. For now I'll mark this one SOLVED.

-z
Top
Post Reply

2 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic