Re: Connecting the slave to the master via Unix sockets

180 views
Skip to first unread message

Josiah Carlson

unread,
Apr 26, 2013, 10:33:47 AM4/26/13
to redi...@googlegroups.com
There currently is no way to slave from a unix domain socket.

There were several people about 2 months ago that were talking about the same thing. If you were to write a patch, it may get accepted.

 - Josiah



On Wed, Apr 24, 2013 at 6:37 AM, P@ta In.SEO <pata....@gmail.com> wrote:
I had a need to connect the slave to the master that is already running on Unix socket. Is it possible to implement it without going to tсp/ip?

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Salvatore Sanfilippo

unread,
Apr 29, 2013, 4:20:34 AM4/29/13
to Redis DB
Hello,

what is the advantage in your specific setup for using unix sockets
for replication?

Thanks,
Salvatore

On Wed, Apr 24, 2013 at 3:37 PM, P@ta In.SEO <pata....@gmail.com> wrote:
> I had a need to connect the slave to the master that is already running on
> Unix socket. Is it possible to implement it without going to tсp/ip?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to redis-db+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/redis-db?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org

Beauty is more important in computing than anywhere else in technology
because software is so complicated. Beauty is the ultimate defence
against complexity.
— David Gelernter

Didier Spezia

unread,
Apr 29, 2013, 8:09:30 AM4/29/13
to redi...@googlegroups.com

For replication, I tend to think it would not bring significant improvements.

Using Unix sockets is mostly useful when there are lots of roundtrips
with small data (i.e threads/processes ping pong game). Otherwise,
it is not that different from TCP loopback. This point can easily be checked:

- compare the result of redis-benchmark (TCP loopback vs Unix sockets)
  when pipelining is not used. On Linux, you should almost see a 50%
  increase in throughput for Unix sockets.

- do the same test again while using pipelining (-P 100). On Linux,
  the difference will be much less spectacular.

Replication is a one-way pipe, there is no roundtrip, everything
is pipelined. So the benefit of a Unix socket should be very limited.

Regards,
Didier.

Salvatore Sanfilippo

unread,
Apr 29, 2013, 9:41:48 AM4/29/13
to Redis DB
On Mon, Apr 29, 2013 at 2:09 PM, Didier Spezia <didi...@gmail.com> wrote:

> Replication is a one-way pipe, there is no roundtrip, everything
> is pipelined. So the benefit of a Unix socket should be very limited.

Exactly, that's my rationale for not wanting this support.
Thanks for your in depth explanation.

Cheers,
Salvatore

Salvatore Sanfilippo

unread,
May 10, 2013, 2:02:00 PM5/10/13
to Redis DB
What about using password protection for instances?

With "masterauth" in the slave side you can be sure that only the slave can connect.
Just pick a huge random SHA1-sized password.

Salvatore


On Fri, May 10, 2013 at 6:56 PM, <toniy...@gmail.com> wrote:
Hi,

I'm also interested. I see that the discussion has mostly been about a (small to nonexistent) perfomance gain. My motivation for the request is security.

Using a unix socket I can manage access rules to the server using file system permissions. With a current replication option I have to open a TCP socket for the slave connection, and there is no simple way to restrict local processes connecting the server. I can restrict access using firewall with rules that applies to certain users only, but unix sockets would be a cleaner approach.

Thanks for you interest,
Toni Ylenius
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

toniy...@gmail.com

unread,
May 10, 2013, 2:24:28 PM5/10/13
to redi...@googlegroups.com
Yes that is sufficient approach, but not as clean as I would prefer. In addition requirepass will request a password also from my clients that are connected using a unix socket and the authentication with a long password is a lot of overhead because the clients don't keep connections open (my bad). However I can live with the situation, but I would appreciate 'SLAVEOF /var/run/redis/redis.sock'.

Regards,
Toni
Reply all
Reply to author
Forward
0 new messages