# How can nginx supports more than 64511 concurrent backend connections?

**URL:** <https://www.ruby-forum.com/t/how-can-nginx-supports-more-than-64511-concurrent-backend-connections/219928>\
**Category:** NGINX\
**Created:** [May 22, 2012, 10:05am UTC](https://www.ruby-forum.com/t/how-can-nginx-supports-more-than-64511-concurrent-backend-connections/219928 "2012-05-22T10:05:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [May 22, 2012, 10:05am UTC](https://www.ruby-forum.com/t/how-can-nginx-supports-more-than-64511-concurrent-backend-connections/219928/1 "2012-05-22T10:05:54Z")

</div>

Hello nginx fans,

I’m using nginx (with ngx\_redis2 module) as a redis client, and would  
like to establish more than 64511 keep alive connections with a redis  
instance. The local port range of Linux is limited to 64511, so I’d like  
to set up multiple ip addresses for nginx machine, but I don’t know how  
to tell nginx to bind local port on multiple ip addresses. Anyone has  
the experience? Thanks in advance.

Posted at Nginx Forum:

> **[How can nginx supports more than 64511 concurrent backend connections?](https://forum.nginx.org/read.php?2,226708,226708#msg-226708)**
>
> Hello nginx fans, I'm using nginx (with ngx\_redis2 module) as a redis client, and would like to establish more than 64511 keep alive connections with a redis instance. The local port range of Linux is limited to 64511, so I'd like to set up multiple...

---

<div class="post-metadata">

**Author:** ![diogin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7cd45c/32.png) [@diogin](https://www.ruby-forum.com/u/diogin)\
**Post date:** [May 23, 2012, 6:47pm UTC](https://www.ruby-forum.com/t/how-can-nginx-supports-more-than-64511-concurrent-backend-connections/219928/2 "2012-05-23T18:47:14Z")

</div>

On Tue, 2012-05-22 at 04:05 -0400, diogin wrote:

> Hello nginx fans,
> 
> I’m using nginx (with ngx\_redis2 module) as a redis client, and would  
> like to establish more than 64511 keep alive connections with a redis  
> instance. The local port range of Linux is limited to 64511, so I’d like  
> to set up multiple ip addresses for nginx machine, but I don’t know how  
> to tell nginx to bind local port on multiple ip addresses. Anyone has  
> the experience? Thanks in advance.

You could also give the redis instance multiple IP addresses and then  
put those instances in an upstream block so Nginx will round-robin them.

The port limitation is 64K per address _pair_ (local, remote), so you  
can add IP’s on either side to get the same effect.

Cliff
