Skip to content

Enable cluster slave back channel tuning #2109

Open

Description

@allanwax

On a production machine we frequently have 2 NICs. Since there is no way (apparently) to configure the slaves that are being written in the background to use a different NIC, it is very possible to have replication going over the same NIC as client requests even though another NIC is available. This potentially slows down client requests and responses.

I'd like to see a cluster configuration value that specifies which NIC to use for client requests and which for replication.

Activity

  1. allanwax commented on Oct 28, 2014

    @allanwax
    Author

    I believe this is the same idea but in this case I'm looking to have the traffic physically go through two different pieces of hardware.

  2. mattsta commented on Oct 28, 2014

    @mattsta
    Contributor

    Well, it just requires specifying an IP address on the other interface, right?

  3. allanwax commented on Oct 28, 2014

    @allanwax
    Author

    It's a question of specifying the outgoing traffic, not the incoming traffic. And in both cases, during failover the software needs to be aware to stop listening on one NIC and start listening on the other. The master reads client requests from NIC1 and sends slave replication data through NIC2. Slaves receive traffic on NIC2 and if the slave becomes the master then it needs to switch over to use NIC1 for the clients. And all the other redis instances need to know this too.

  4. mattsta commented on Oct 28, 2014

    @mattsta
    Contributor

    Just to get terminology correct: listening happens on IP addresses, not interfaces, right?

    What do you mean by:

    during failover the software needs to be aware to stop listening on one NIC and start listening on the other

    During failover over what? If the software or server has failed, then there's nothing to failover with regard to accepting new connections. (Also, all the IPs Redis listens on accept every kind of operation, so any available address can do all actions.)

    It's a question of specifying the outgoing traffic, not the incoming traffic.

    Redis uses the first bind IP as the source for server-originated (replication, clustering) traffic. So, I think you can mostly get the behavior you need by specifying your internal cluster/replication IP first then the regular client IP address second.

    If you give Redis "bind [cluster-communication-ip] [client-communication-ip]" then all cluster and replication will happen from the first listed IP. Redis won't originate any traffic from the second IP, but it will accept any commands sent to it from the second IP.

    it needs to switch over to use NIC1 for the clients.

    All Redis IPs can be used for any operation, so there shouldn't need to be any switching necessary that I can think of?

  5. allanwax commented on Oct 28, 2014

    @allanwax
    Author

    "All Redis IPs can be used for any operation" that's the point. I'm looking to physically partition the client and slave traffic so there is no interference in the client traffic. All client traffic goes in and out through one NIC and all slave replication traffic goes out through another. The slave only gets incoming master replication traffic on the 'configured' slave replication NIC/IP:port. Nothing comes though the slave 'client' port. When the slave is promoted to master, the client NIC/IP:port is used and the replication NIC is used to send replication data. What was an incoming NIC for the slave has now become an outgoing replication NIC for the master.

    I don't think specifying a 'bind' address is good enough if client traffic can spill over to either NIC.

  6. mattsta commented on Oct 28, 2014

    @mattsta
    Contributor

    Nothing comes though the slave 'client' port. When the slave is promoted to master, the client NIC/IP:port is used and the replication NIC is used to send replication data.

    Yup, that's exactly how Redis works now with the multiple-IP bind setup (it's just not very explicit in the configuration).

    I don't think specifying a 'bind' address is good enough if client traffic can spill over to either NIC.

    Terminology lapse again. What does "spill over" mean here?

    Clients could use either IP address, but that's more of a configuration issue with your clients than a Redis permission issue. If your clients are configured only to talk to the client-serving IP address, there's no way client traffic will enter the primary replication/cluster IP address.

  7. allanwax commented on Oct 28, 2014

    @allanwax
    Author

    I think you've answered it now. By spill over I mean that the clients can use either incoming port but I want to restrict that.

    If replication data can be restricted to only effectively using one of the NIC's, and during transition from slave to master that restriction is applied, and it's different than the usual client NIC, then that is the functionality I'm looking for.

    It would be nice if it was written up as to how to do this in a more explicit way but I'm good for now.

  8. mattsta commented on Oct 28, 2014

    @mattsta
    Contributor

    It would be nice if it was written up as to how to do this in a more explicit way but I'm good for now.

    I'll look into writing up this configuration somewhere. Thanks for all the details!

  9. antirez commented on Oct 31, 2014

    @antirez
    Contributor

    Looks like something we want an explicit documentation for at redis.io: Multiple NICs configurations. This is a big use case, basically many high traffic users discovered soon or later that single NIC setup is a bottleneck.

  10. mattsta commented on Oct 31, 2014

    @mattsta
    Contributor

    documentation for at redis.io: Multiple NICs configurations.

    On the ML someone pointed out Redis can't support replication-only interfaces when used with Sentinel because Sentinel will announce the replication-only interface to clients too.

    Whoops.

    So Redis may need a new config option for "replication-only-interface" versus "client-only-interface." Sentinel can still use and advertise the client IP addresses, but the individual instances will know to use the replication-only interface to initiate replication/cluster-bus communication. (And Redis could potentially deny SYNC/PSYNC requests from the client-only interface.)

  11. allanwax commented on Nov 24, 2014

    @allanwax
    Author

    A thought: if "replication-only-interface" and "client-only-interface" are set in a master, then it makes sense to impose the requested restriction. But in a slave it may be OK to ignore these values and use both NICs the same. If the slave becomes a master then the restriction would be applied again.

    Again, just a thought.

  12. LeonxLJX commented on Sep 1, 2026

    @LeonxLJX

    I'd like to take this one (Enable cluster slave back channel tuning). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)

  13. LeonxLJX commented on Sep 1, 2026

    @LeonxLJX

    I'd like to take this one (Enable cluster slave back channel tuning). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)

  14. LeonxLJX commented on Sep 1, 2026

    @LeonxLJX

    I'd like to take this one (Enable cluster slave back channel tuning). I'll dig into the root cause and follow up with a PR shortly. (claiming via @LeonxLJX)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions