question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lots of new connection + COMMAND to slaves in Redis Cluster

See original GitHub issue

Bug Report

Current Behavior

In the current Redis Cluster setup with 3 masters and 3 slaves, my java daemon is reconnecting to one of the slaves continuously. When performing a tcpdump, I constantly see a new connection being opened, a COMMAND being sent, then the connection closes again (the TCP FIN is initiated by the client).

Input Code

We’re just using Spring Boot 2.0.0 with Lettuce to connect to Redis. This seems to be done by the library, since I don’t have specific code here. Just using the RedisTemplates in a few places.

Expected behavior/code

I expected that the slaves are connected to once to get the cluster information and maybe a single connection to keep checking the status. I have no idea why it keeps opening and closing connections.

Environment

  • Lettuce version(s): 5.0.2
  • Redis version: 3.2.10

Additional context

We are using a lot of connections on a busy server. I’m not able to reproduce it locally when not performing a lot of actions.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mp911decommented, Jul 24, 2018

minIdle, maxIdle and maxActive are the numbers of logical connections. A Lettuce Cluster connection consists itself then of multiple physical connections:

Consider:

(number of nodes n x 2) + 1

That’s the total maximum of physical connections that are bundled under a logical connection.

Closing this ticket as the issue is solved externally.

0reactions
flowinglightcommented, Feb 21, 2021

hi @marcdejonge what config (and properties) did you use to get around of this issue? We have seen the same problem now and updating versions doesn’t help either.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scaling with Redis Cluster
Every Redis Cluster node requires two open TCP connections: a Redis TCP port ... The command used here is create, since we want...
Read more >
Too many TCP connections between redis master and slave
@Grabusz - We are using redis 4.0.9. The maxclients is set as 4096. One observation is say we have 2 nodes A(master) and...
Read more >
redis.conf for Redis 3.2 - GitHub
When a new command is logged the oldest one is removed from the # queue of logged commands. # The following time is...
Read more >
Installing a High Available Redis Cluster | by Erdem OZDEMIR
Let's create a 3 nodes redis cluster which has 1 master and 2 slaves. ... By using vagrant ssh command respectively, we can...
Read more >
Replication - Redis Documentation - Read the Docs
There are two Redis commands that provide a lot of information on the current replication parameters of master and slave instances. One is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found