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.

Redis cluster refresh of large clusters keeps I/O threads busy

See original GitHub issue

Bug Report

Current Behavior

For large redis cluster, using enablePeriodicRefresh causes serious performance problems.

The processing time required for DefaultClusterTopologyRefresh.getNodeSpecificViews increases in proportion to the cluster size. Unfortunately, this is executed in the NIO event loop thread.

See the repository README below for details. https://github.com/be-hase/lettuce-with-large-cluster

Input Code

I have prepared the code that can reproduce this problem. https://github.com/be-hase/lettuce-with-large-cluster

Expected behavior/code

Even if we use enablePeriodicRefresh with large redis cluster, the performance will not deteriorate.

Environment

  • Lettuce version(s): 6.1.6.RELEASE
  • Redis version: 6.2.0

Possible Solution

Idea 1

Stop running DefaultClusterTopologyRefresh.getNodeSpecificViews on the NIO event loop.

I won’t go into details, but if I customized DefaultClusterTopologyRefresh and ran it on another thread, the performance improved.

My team is considering adopting this method as a workaround.

Idea 2

Looking at the previous framegraph, it seems that the overhead is large in the processing using BitSet. Why not change to a more primitive method like boolean[] ?

However, I’m not sure if the performance will improve.

Additional context

NONE

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:13
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
be-hasecommented, Mar 17, 2022
1reaction
mp911decommented, Mar 16, 2022

Feel free to submit a pull request to use ClientResources.eventExecutorGroup() in the future chaining in DefaultClusterTopologyRefresh.getNodeSpecificViews

Read more comments on GitHub >

github_iconTop Results From Across the Web

High-Concurrency Practices of Redis: Snap-Up System
All commands are processed by a single thread, and all reads, processes, and writes run in the same main I/O. There are several...
Read more >
YujiSoftware on Twitter: "これかな https://t.co/Zjqcw2PDoY ...
Redis cluster refresh of large clusters keeps I/O threads busy · Issue #2045 · lettuce-io/lettuce... Bug Report Current Behavior For large ...
Read more >
Scaling with Redis Cluster
Redis Cluster provides a way to run a Redis installation where data is automatically sharded across multiple Redis nodes. Redis Cluster also provides...
Read more >
Lettuce Reference Guide
Lettuce is a scalable thread-safe Redis client based on netty and Reactor. ... Cluster topology refresh is now non-blocking.
Read more >
lettuce-io/Lobby - Gitter
The cluster topology refresh is blocking. In reality, if you have multiple clusters then the refresh might get delayed a bit if the...
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