Giter VIP home page Giter VIP logo

Comments (7)

etaty avatar etaty commented on July 18, 2024 1

No the client is always connected to the server.
If you use a pool you can dispatch the connexion on many redis server, (or put the same server multiple times in the Seq of redis servers).
If you only have one server, and don't need many connexion then you can use a RedisClient.

from rediscala.

gsastry avatar gsastry commented on July 18, 2024 1

Thanks for your prompt and helpful replies. I wasn't aware that the connection is keep-alived. Is there any advantage to putting the same server multiple times in the Seq of redis servers? Will that round robin the request to different connections to the same server (essentially using a connection pool)?

BTW, do you mind pointing me to the code where it's specified as a keep-alive connection?

from rediscala.

etaty avatar etaty commented on July 18, 2024 1

Yes it will round robin the connections. if your CPU is not already overloaded with just one you can add more for more throughput

from rediscala.

kajmagnus avatar kajmagnus commented on July 18, 2024 1

Thanks for posting these questions & answers :- ) It wasn't clear to me when & why to use the connection pool, and when not to — so I searched all GitHub issues for "connection" and then I found this topic.

I think it'd make sense to rewrite & include the stuff in this topic in the main readme.

(Some stuff from this topic: #22 about how to avoid bad performance when writing async requests, could also be in the main docs perhaps)

from rediscala.

etaty avatar etaty commented on July 18, 2024

Any redis clients will try to reconnect to the server every 2s if the connection is lost.

from rediscala.

gsastry avatar gsastry commented on July 18, 2024

The client opens a connection per request, right? Is there any way to have it open a few connections that serve all the request, and keep the connections persistent?

from rediscala.

gsastry avatar gsastry commented on July 18, 2024

Thanks. Just to confirm, the connections are set as keep-alive=true by default?

from rediscala.

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.