Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have application servers with memcached running on them.

What will happen if I make a request to memcached on, which just happens to be the originating server? Will it use the same fast-path tcp/ip stack as, or would I get better performance by checking if is the same box, and substituting

Normally it wouldn't matter so much, because odds are the item you want is going to be in a memcached on another application server, but in this case the load-balancer divides requests so that it's very likely that most of the memcached requests will resolve to the local memcached instance.

share|improve this question

migrated from Dec 3 '09 at 2:08

This question came from our site for professional and enthusiast programmers.

What operating system are you using? I'll hazard a guess and say that it will be about the same level of performance using either method, as the dns record for 10.243.... should be cached. Have you tried timing it both ways?

share|improve this answer
DNS record for an IP address? Surely you mean ARP? – Jacob Krall Dec 1 '09 at 18:52
Linux 2.6, but IIRC there is actually special treatment for, where it doesn't go through the tcp/ip stack, it runs at closer to shared memory speeds - so there is the possibility of there being a large difference in performance. – Eloff Dec 1 '09 at 19:18
ARP isn't even going to be involved on the same machine, there's no need to ARP for something that isn't transmitted on the wire. – Michael Graff Dec 3 '09 at 2:41

Sounds like you already know the answer ;). In many cases UNIX will use:

Unix Domain sockets are faster than TCP/IP/UDP because their is no network stack involved. Many UNIX applications will use Unix Domain sockets for local communication, like for instance your database drivers, or memcached. This isn't always the case, and you should be careful not to confuse Unix domain sockets with UDP, which is completely different.

share|improve this answer

Many OSs have optimized the loopback interfaces. Chances are, the packets will hit the routing table, see that it is local, and follow a fast-path routing to the input on the same machine. No ethernet drivers nor ARP nor other things will be touched.

If you look, chances are your MTU will also be much larger on the loopback too.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.