客户端 和 redis服务端连接时候,临时tcp的端口不够的时候怎么办?

WBOY
Release: 2016-06-06 20:16:47
Original
1483 people have browsed it

  1. 服务端的端口总是有限的,如果在大并发的情况下,redis服务端是如何分配零时端口的

2.im服务中 服务端的是如何分配连接端口的,大量的连接过来时,如果临时端口不够用,是否其他连接就连接不进来,还是先分配一个假的端口,等执行的时候重新分配

回复内容:

  1. 服务端的端口总是有限的,如果在大并发的情况下,redis服务端是如何分配零时端口的

2.im服务中 服务端的是如何分配连接端口的,大量的连接过来时,如果临时端口不够用,是否其他连接就连接不进来,还是先分配一个假的端口,等执行的时候重新分配

Redis Socket.

这种情况是存在的,但是一般情况下redis的单个命令耗时很短,很少有客户端会长时间占用连接不释放(连接池是个例外,不过是利好),同时redis本身是可以限制客户端连接的数量的,默认是10000,而端口的范围是1024~32768之间,数量是足够的,同时单一进程可打开文件数也是有限制的,基本都不会超过端口数量。
个人觉得超过端口数量的情况还是很少的,不过如果真的发生这种问题在tcp connect()的时候就会出错,属于内核错误,客户端根本无法连接上服务器,所以这时候服务端也无法进行分配假的端口这种处理吧。

提供一篇文章:http://blog.csdn.net/guowake/article/details/6615728

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!