Discussion:
[redis-db] Multiple redis instance using same IP and port number
Muktadir Rahman Chowdhury
2018-10-19 18:19:29 UTC
Permalink
Hi All,
Is it possible to have multiple redis instances on the same server
listening to same IP and port number?

Muktadir Chowdhury
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
h***@gmail.com
2018-10-20 02:48:43 UTC
Permalink
No, that's not possible. Redis doesn't follow a forking or redirect model
in how it handles incoming connections. A single daemon process handles
all connections. Pretty much only snapshot saving to disk uses a forking
model.

On Friday, October 19, 2018 at 11:32:23 AM UTC-7, Muktadir Rahman Chowdhury
Post by Muktadir Rahman Chowdhury
Hi All,
Is it possible to have multiple redis instances on the same server
listening to same IP and port number?
Muktadir Chowdhury
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Vali Dr
2018-10-20 03:32:10 UTC
Permalink
I think you can.
You run some proxy on the server, with the "public" ip and your "public"
port, and then have multiple redis instances listening on localhost, each
with it's own port.
Post by h***@gmail.com
No, that's not possible. Redis doesn't follow a forking or redirect model
in how it handles incoming connections. A single daemon process handles
all connections. Pretty much only snapshot saving to disk uses a forking
model.
On Friday, October 19, 2018 at 11:32:23 AM UTC-7, Muktadir Rahman
Post by Muktadir Rahman Chowdhury
Hi All,
Is it possible to have multiple redis instances on the same server
listening to same IP and port number?
Muktadir Chowdhury
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Itamar Haber
2018-10-20 12:57:06 UTC
Permalink
Hello Muktadir,

The community is right - you can't do this with Redis but you can do this
with a proxy before it. The question is what are you trying to do, or
rather why are you looking to do that?
Post by Vali Dr
I think you can.
You run some proxy on the server, with the "public" ip and your "public"
port, and then have multiple redis instances listening on localhost, each
with it's own port.
Post by h***@gmail.com
No, that's not possible. Redis doesn't follow a forking or redirect
model in how it handles incoming connections. A single daemon process
handles all connections. Pretty much only snapshot saving to disk uses a
forking model.
On Friday, October 19, 2018 at 11:32:23 AM UTC-7, Muktadir Rahman
Post by Muktadir Rahman Chowdhury
Hi All,
Is it possible to have multiple redis instances on the same server
listening to same IP and port number?
Muktadir Chowdhury
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
--
*Itamar Haber*
Technicalist Evangely

Phone: +972.54.567.9692

[image: Redis Labs] <https://redislabs.com/>
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Muktadir Rahman Chowdhury
2018-10-22 17:24:36 UTC
Permalink
Hi All,
Thanks for your suggestion. I want to do this for research purpose. I have
an implementation of redis, which is using DPDK <https://www.dpdk.org/>as
packet I/O and mTCP <https://github.com/eunyoung14/mtcp> as TCP stack. This
implementation can run different redis instances listening on the same
IP:port. So I want to compare this implementation with the original one. I
can do this by changing the redis code. But if redis has built-in support
for that than I don't have to change the code. Can anyone tell me what are
things I need to keep in mind when changing the code to support this
functionality?

-Muktadir
Post by Itamar Haber
Hello Muktadir,
The community is right - you can't do this with Redis but you can do this
with a proxy before it. The question is what are you trying to do, or
rather why are you looking to do that?
Post by Vali Dr
I think you can.
You run some proxy on the server, with the "public" ip and your "public"
port, and then have multiple redis instances listening on localhost, each
with it's own port.
Post by h***@gmail.com
No, that's not possible. Redis doesn't follow a forking or redirect
model in how it handles incoming connections. A single daemon process
handles all connections. Pretty much only snapshot saving to disk uses a
forking model.
On Friday, October 19, 2018 at 11:32:23 AM UTC-7, Muktadir Rahman
Post by Muktadir Rahman Chowdhury
Hi All,
Is it possible to have multiple redis instances on the same server
listening to same IP and port number?
Muktadir Chowdhury
--
You received this message because you are subscribed to the Google Groups
"Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
--
*Itamar Haber*
Technicalist Evangely
Phone: +972.54.567.9692
[image: Redis Labs] <https://redislabs.com/>
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
h***@gmail.com
2018-10-23 09:29:13 UTC
Permalink
Do you intend for the multiple Redis server processes to each have an
independent database, for for the processes to share the same database?
Will these multiple Redis server processes have other sorts of
relationships with each other, such as master/replica? How about the
sharded Redis Cluster?


On Monday, October 22, 2018 at 10:24:37 AM UTC-7, Muktadir Rahman Chowdhury
Post by Muktadir Rahman Chowdhury
Hi All,
Thanks for your suggestion. I want to do this for research purpose. I have
an implementation of redis, which is using DPDK <https://www.dpdk.org/>as
packet I/O and mTCP <https://github.com/eunyoung14/mtcp> as TCP stack.
This implementation can run different redis instances listening on the same
IP:port. So I want to compare this implementation with the original one. I
can do this by changing the redis code. But if redis has built-in support
for that than I don't have to change the code. Can anyone tell me what are
things I need to keep in mind when changing the code to support this
functionality?
-Muktadir
Post by Itamar Haber
Hello Muktadir,
The community is right - you can't do this with Redis but you can do this
with a proxy before it. The question is what are you trying to do, or
rather why are you looking to do that?
Post by Vali Dr
I think you can.
You run some proxy on the server, with the "public" ip and your "public"
port, and then have multiple redis instances listening on localhost, each
with it's own port.
Post by h***@gmail.com
No, that's not possible. Redis doesn't follow a forking or redirect
model in how it handles incoming connections. A single daemon process
handles all connections. Pretty much only snapshot saving to disk uses a
forking model.
On Friday, October 19, 2018 at 11:32:23 AM UTC-7, Muktadir Rahman
Post by Muktadir Rahman Chowdhury
Hi All,
Is it possible to have multiple redis instances on the same server
listening to same IP and port number?
Muktadir Chowdhury
--
You received this message because you are subscribed to the Google
Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
--
*Itamar Haber*
Technicalist Evangely
Phone: +972.54.567.9692
[image: Redis Labs] <https://redislabs.com/>
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
The Real Bill
2018-10-24 04:12:36 UTC
Permalink
On Friday, October 19, 2018 at 1:32:23 PM UTC-5, Muktadir Rahman Chowdhury
Post by Muktadir Rahman Chowdhury
Hi All,
Is it possible to have multiple redis instances on the same server
listening to same IP and port number?
Muktadir Chowdhury
No, this is due to operating system restrictions in that only one process
an own a socket, which is what the IP and port number pair represents.
While in theory you could have a "proxy" layer where it sends data to
Redis instances each running on their own port, you would need to find a
way to consistently route the traffic. This is non-trivial, to put it
mildly. To get an idea of how non-trivial it is, consider what DPDK does to
make you think that is what is happening: it has its own TCP implementation
(kernel space driers and all) and even then the IP:Port is essentially
virtualized and you have to have some form of traffic switching and routing
to get from the socket to the processes. Even then, IIRC, in a DPDK app
there is still a single master process that handles actual packet I/O
operations and passes the data off to client processes. Some of the
confusion around it is the terminology. DPDK has a tendency to refer to a
physical plug on a NIC, or the virtual plug on a virtual device, as a
"port". While this is technically accurate, it can be confusing when
talking about a numeric port number that is paired with an IP address.

It has been a while since I've been in DPDK but I suspect it hasn't really
changed much. If you can share how you're using DPDK in your implementation
(ie, are we talking about a virtual switch interface, a vNIC, vhost,
master/child procs) and how the "multiple instances" are used I can try to
help determine how, or even if, a comparison to "plain Redis" would map
over.

Cheers,
Bill
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Loading...