Skip to content

Improve connection speed by running fewer commands #2850

Open
@chayim

Description

@chayim
Contributor

Today, connecting to a Redis instance, involves running multiple commands, and parsing the response repeatedly, this includes usage such as setinfo, which itself is run twice. The example below illustrates, that it's possible to pass all connection configuration information within a pipeline. In turn, the HELLO call returns the version of Redis, which could perhaps be used later for other things.

This is marked as good-first-issue not because it's necessarily easy to implement, inasmuch as it's a good entrypoint, to learning how connections to redis occur.

127.0.0.1:6379> multi
OK
127.0.0.1:6379(TX)> auth bob smurf
QUEUED
127.0.0.1:6379(TX)> select 5
QUEUED
127.0.0.1:6379[5](TX)> hello 3
QUEUED
127.0.0.1:6379[5](TX)> client setinfo lib-name predis
QUEUED
127.0.0.1:6379[5](TX)>  client setinfo lib-ver 55.5.0
QUEUED
127.0.0.1:6379[5](TX)> client tracking on optin
QUEUED
127.0.0.1:6379[5](TX)> CLIENT caching yes
QUEUED
127.0.0.1:6379[5](TX)> exec
1) OK
2) OK
3) 1# "server" => "redis"
   2# "version" => "7.2.3"
   3# "proto" => (integer) 3
   4# "id" => (integer) 26
   5# "mode" => "standalone"
   6# "role" => "master"
   7# "modules" => (empty array)
4) OK
5) OK
6) OK
7) OK
127.0.0.1:6379[5]> 

Activity

prabhjotsingh18

prabhjotsingh18 commented on Dec 28, 2023

@prabhjotsingh18

Hey @chayim,
total newbie here, I would love to take this up, but I would require assistance.
If you can help me with stating the point and blueprint of how this can be implemented, that would be great.

chayim

chayim commented on Jan 30, 2024

@chayim
ContributorAuthor

@prabhjotsingh18 want to give it a go and ping here @ofekshenawa can possibly assist.

prabhjotsingh18

prabhjotsingh18 commented on Mar 10, 2024

@prabhjotsingh18

Sure @chayim, @ofekshenawa if you can guide me where to begin and what concepts I need to familiarise myself with.

pglushko

pglushko commented on Apr 4, 2024

@pglushko

@prabhjotsingh18 are you still working on this?

prabhjotsingh18

prabhjotsingh18 commented on Apr 21, 2024

@prabhjotsingh18

hey @pglushko ,
i have no idea how to proceed with the issue, was waiting on @ofekshenawa for direction, if you want you can take up the bug.

subhakundu

subhakundu commented on Jun 9, 2024

@subhakundu

@pglushko are you actively working on this task? If not, please let me know. I would love to work on this issue. I would like to know how connections are working in Redis.

subhakundu

subhakundu commented on Jun 10, 2024

@subhakundu

@chayim and @ofekshenawa, I am not sure if anyone is working on this issue or not. If not, I would like to work on it to learn. I would like your guidance on where to start.

KyleKincer

KyleKincer commented on Jul 13, 2024

@KyleKincer
joe-ton

joe-ton commented on Mar 18, 2025

@joe-ton

Hi @chayim, @ofekshenawa — I see there's been some discussion and uncertainty about the current state of this issue. I'm new to contributing to go-redis and I'd love to help here.

Before diving in, I noticed @KyleKincer pointed out this might have been addressed already in #326. Could someone confirm if the optimization is still needed or clarify what's specifically missing?

Happy to contribute and eager to learn more about Redis connection handling in the process. Appreciate any guidance to get started!

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

        Participants

        @chayim@subhakundu@pglushko@prabhjotsingh18@KyleKincer

        Issue actions

          Improve connection speed by running fewer commands · Issue #2850 · redis/go-redis