I have memcache server listing on 0.0.0.0:11211. I have to query the memcached server from the same box. Which one do you think is better: querying from 127.0.0.1:11211 or from interface-ip:11211. Please explain why also ?
Asked
Active
Viewed 326 times
0
-
See [What's the difference between ip address 0.0.0.0 and 127.0.0.1?](http://serverfault.com/q/78048/126632) – Michael Hampton Mar 11 '13 at 08:20
-
I know the difference . What i meant is which one better , querying 127.0.0.1 or interface-ip ? – pradeepchhetri Mar 11 '13 at 08:33
2 Answers
1
I have to query the memcached server from the same box.
Why not use Unix socket to avoid TCP/IP overhead:
$ memcached -h
memcached 1.2.8
repcached 2.2
-p <num> TCP port number to listen on (default: 11211)
-U <num> UDP port number to listen on (default: 11211, 0 is off)
-s <file> unix socket path to listen on (disables network support)
See also: Unix domain sockets vs TCP Sockets
![](../../users/profiles/190981.webp)
Anthony Geoghegan
- 2,800
- 1
- 23
- 34
![](../../users/profiles/59925.webp)
quanta
- 50,327
- 19
- 152
- 213
-
The thing is that i am configuring graphite to use memcached.. which can only use tcp/ip sockets. – pradeepchhetri Mar 11 '13 at 09:07
-1
querying to 127.0.0.1:11211 is better as compared to querying memcached on interface ip.
![](../../users/profiles/93248.webp)
Abhishek Anand Amralkar
- 1,949
- 12
- 16
-
3
-
3Not a complete answer - the question specifically asks "please explain why also". – Jenny D Mar 11 '13 at 10:20