UNIX socket connection to memcached instead of tcp/ip?

799 views
Skip to first unread message

Devlin McGregor

unread,
Jun 11, 2013, 12:06:44 AM6/11/13
to spymem...@googlegroups.com
We deploy memcached on our app servers nodes and use localhost:11211 for access. I understand there's some overhead with tcp/ip despite requests being routed on the local network interface, but I read using UNIX sockets for talking to memcached is a performance booster and reduces response time latency. Does spy support unix socket type connections?

Matt Ingenthron

unread,
Jun 11, 2013, 1:05:28 AM6/11/13
to spymem...@googlegroups.com

On Jun 10, 2013, at 9:06 PM, Devlin McGregor <devlin...@gmail.com> wrote:

> We deploy memcached on our app servers nodes and use localhost:11211 for access. I understand there's some overhead with tcp/ip despite requests being routed on the local network interface, but I read using UNIX sockets for talking to memcached is a performance booster and reduces response time latency. Does spy support unix socket type connections?

spymemcached doesn't support this, no.

Generally speaking, people use memcached because it distributes easily, and UDS doesn't distribute at all.

While it is probably measurable… probably in terms of CPU usage and maybe on latency at something like the max 99th percentile, you're talking about probably a microsecond or two of latency difference.

If a couple of µsec and the CPU usage are noticeable in your deployment, then you've already tuned the heck out of the JVM for your app, probably wrote your own transcoder, and are operating something like an ad targeting network. Well, the last one isn't very likely on one system. :) Or more likely, you'll put everything in one process.

Hope that helps,

Matt

Devlin McGregor

unread,
Jun 11, 2013, 9:35:33 AM6/11/13
to spymem...@googlegroups.com
Matt,



spymemcached doesn't support this, no.  


Is there any memcached client that supports this; we want to test it for local access only, not distributed.

 
Generally speaking, people use memcached because it distributes easily, and UDS doesn't distribute at all.


Just to be clear, memcached alone is not distributed, it's the clients (like spy) that perform distribution based on consistent hashing, etc, correct?
 
Matt

Matt Ingenthron

unread,
Jun 11, 2013, 6:16:21 PM6/11/13
to spymem...@googlegroups.com
Hi Devlin,

On Jun 11, 2013, at 6:35 AM, Devlin McGregor <devlin...@gmail.com> wrote:

Matt,


spymemcached doesn't support this, no.  


Is there any memcached client that supports this; we want to test it for local access only, not distributed.

IIRC, libmemcached does and you can probably get to it through pecl-memcached.

Of course, we'd also take a patch against spymemcached to support UDS.  :)


 
Generally speaking, people use memcached because it distributes easily, and UDS doesn't distribute at all.


Just to be clear, memcached alone is not distributed, it's the clients (like spy) that perform distribution based on consistent hashing, etc, correct?

Correct, memcached itself doesn't distribute, but variants such as couchbase add more on top to distribute.

The thing is, if you're looking at sharing memory between multiple processes, UDS against memcached would be an okay step, but shared memory may be even better.  Threads or some other kind of concurrency accessing the same memory would be even better, since that even cuts the syscall out of the loop.

Hope that helps,

Matt

Reply all
Reply to author
Forward
0 new messages