Skip to content

Improve connection speed by running fewer commands #3090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chayim opened this issue Dec 25, 2023 · 2 comments
Closed

Improve connection speed by running fewer commands #3090

chayim opened this issue Dec 25, 2023 · 2 comments

Comments

@chayim
Copy link
Contributor

chayim commented Dec 25, 2023

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]> 
@fatelei
Copy link

fatelei commented Jan 14, 2024

assign to me

@chayim chayim added this to the connection-improvements milestone Feb 5, 2024
@chayim chayim removed this from the connection-improvements milestone Feb 14, 2024
Copy link
Contributor

This issue is marked stale. It will be closed in 30 days if it is not updated.

@github-actions github-actions bot added the Stale label Mar 16, 2025
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants