kingsleysong / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Allow listening on both TCP/UDP port and Unix sockets #336

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start memcached with -s <socket> and -p <port>
2. Try to connect to port 11211
3. Be surprised when you can't.

What is the expected output? What do you see instead?

I'd expect to still be able to connect with TCP even when using Unix sockets.  
(Yes, it is documented that it doesn't work this way, but I was still 
surprised.)

What version of the product are you using? On what operating system?

1.4.13 on Amazon Linux

Please provide any additional information below.

It would be really nice to be able to combine the efficiency of Unix sockets 
(for local connections) with the flexibility of TCP connections (for remote 
connections).  However, enabling Unix sockets currently disables network 
support.

Would it be difficult to allow both if both -s and -p are provided?

Benchmark speed comparison for local connections:

TCP to 127.0.0.1 port 11211:

[RUN #1,  16 secs]  0 threads:     2000000 ops,  125000 ops/sec, 5.07MB/sec,  
1.64msec latency

Unix socket:

[RUN #1,  14 secs]  0 threads:     2000000 ops,  142857 ops/sec, 5.79MB/sec,  
1.40msec latency

Thanks!

Dan.

Original issue reported on code.google.com by drogers%...@gtempaccount.com on 5 Aug 2013 at 7:21

GoogleCodeExporter commented 9 years ago
Hi!

It would be have nice to have this feature.
I use Collectd to graph Memcached utilization and it's nicer to use socket to 
do that rather than use IP:PORT.

Thanks!

Original comment by nrodrig...@jbox-web.com on 10 Oct 2013 at 4:40

GoogleCodeExporter commented 9 years ago
This is generally a bad idea... We don't let people do this because then they 
start distributing client lists where one is set to localhost instead of the 
interface IP, which changes the map on each client, which means their shit gets 
all messed up.

Maybe we'll allow an override, but I got really sick of people reporting "bugs" 
where they were doing the lists in weird ways. They're still able to do that 
with 127.0.0.1 though...

Bleh, dunno.

Original comment by dorma...@rydia.net on 9 Dec 2013 at 3:13

GoogleCodeExporter commented 9 years ago
Going to close this... it sounds like a nice idea but there aren't any clients 
which will talk to a unix domain socket for a "local instance" without ruining 
your hash ring. There's no way to make use of it unless you're using different 
apps for different things.

Original comment by dorma...@rydia.net on 20 Dec 2013 at 8:54