Giter Site home page Giter Site logo

Comments (4)

mp911de avatar mp911de commented on May 24, 2024

Spring Data Redis hosts multiple connection pools. There are separate pools for reactive and for synchronous usage. Also, if your application uses the Cluster API to run commands on specific nodes, then there's a third pool being created.

Please also keep in mind that Cluster connections consist of multiple connections to the individual Redis Cluster nodes.

If you observe a regular disconnect after 5 minutes, then it seems that some active network component disconnects idle connections. Please watch out for Lettuce logs mentioning disconnects and connection watchdog attempting reconnects.

from spring-data-redis.

spring-projects-issues avatar spring-projects-issues commented on May 24, 2024

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

from spring-data-redis.

joycezhou0621 avatar joycezhou0621 commented on May 24, 2024

@mp911de Thank you for your assistance. I have an additional question. I experimented with not using a connection pool and instead utilizing a shared native connection for our redis cluster, while also enabling eager initialization. Here is our setup.

connectionFactory.setShareNativeConnection(true);
connectionFactory.setEagerInitialization(true);
connectionFactory.afterPropertiesSet();

I noticed some logs indicating that a shared connection was created during bean initialization. However, when a new EC2 node starts up and begins serving traffic, we observe a significant number of Redis command timeout errors. Interestingly, these errors only occur for the first few requests, and afterward, they no longer appear.
Due to the at least 5-minute gap between bean initialization and the node actually starting to serve traffic, is it possible that the shared native connection closed during this time interval? However, we have not set any timeout from the server side. Do you have any insights into why these peculiar Redis command timeout errors only occur during node startup?

from spring-data-redis.

mp911de avatar mp911de commented on May 24, 2024

Due to the at least 5-minute gap between bean initialization and the node actually starting to serve traffic, is it possible that the shared native connection closed during this time interval?

If Redis is configured to drop a connection, then yes, this might happen. Watch closely the debug log to determine what is happening on the transport level.

from spring-data-redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.