Error 99 connecting to 192.168.3.212:6379. Cannot assign requested address

Redis - corelation between QPS, response time, number of connections, response size and network connection speed - Stack Overflow https://stackoverflow.com/questions/28241728/redis-corelation-between-qps-response-time-number-of-connections-response-s

连接数与带宽

Here are my answers:

Want to understand more about this magic.

Redis is awesome, but there is no magic. It is just a smart and efficient implementation of very pragmatic concepts. And because it is a human-sized project, it is actually easy to understand why, by having a look at the source code.

Is this just network latency or Redis has to maintain some overhead till entire data is flushed out.

Of course, Redis has to maintain communication buffers, so that it can deal with slower network links. That said, this should have very little impact on the perceived latency. In your case, the 50 ms are probably mainly due to the network latency, which you could probably check by running a ping command or any other similar tool.

Can number of connections affect Redis throughput?

Of course, it can, like for any server software. Now, you need to distinguish the throughput per connection, and the global throughput of the server.

The throughput per connection is heavily impacted by the number of connections. Consider that the server can only provide a certain bandwidth, and this bandwidth is shared across connections. The more connections, the less bandwidth per connection.

On the other hand, the global throughput of the server is only lightly impacted by the number of connections. Redis can accept tens of thousands of connection with no issue. There is still an overhead though. As a rule of thumb, consider that at 30000 connections, Redis supports only half of the throughput it can support at 100 connections. See the nice graphs available on the Redis benchmark page.

Will the last request take 500muSec * 1000 = 500ms?

Yes, but your figures are probably wrong.

Yes, all activity is serialized (single-threaded design), so the processing time of each command has to be added. When many commands are received at the same time, the last one will be served after all the other ones. If each command takes 5 us to be processed, and 1000 are received at the same time, the last reply will be sent in 5 ms.

Now, in practice, the number of truly concurrent queries is not so high. Redis rarely receives 1000 simultaneous queries in the same event loop iteration.

Furthermore, you are confusing the response time (as measured on client-side), and theprocessing time (that would be measured on Redis side). The response time can be 500 us, but the processing time is much closer to 5 us, the difference being the time spent on the network and in the OS process scheduling. Keep in mind that only the processing time has to be cumulated, everything else is parallelized over the connections (network latency for instance).

To calculate the average processing time of your instance, just use redis-benchmark to saturate the instance. When using pipelining, it is not uncommon to see instances processing up to 400 Kop/s or more, which gives an average processing time of 2.5 us.

Can response size have an affect here?

Of course, it can, like for any server software. Past a certain size, the latency is always impacted by the volume of data, because both the bandwidth and the speed of the network are limited. With ethernet networks, this threshold is closely related to the size of the MTU.

TCP connection on the Redis has to wait till the last packet is delivered and if the network connection is slow, will it slowdown Redis?

Absolutely not. Redis systematically buffers the replies (whatever their size), and manages all sockets in a non-blocking way, thanks to an event loop. If one connection is slow (or one client is slow), Redis will fill the corresponding socket buffer as much it can, register the socket in the event loop, and move to another connection. The event loop will continue sending traffic on the slow connection when there is space again in the socket buffer. Nothing ever blocks.

Error 99 connecting to 192.168.3.212:6379. Cannot assign requested address的更多相关文章

  1. connect() to 192.168.30.71:8082 failed (99: Cannot assign requested address) while connecting to upstream, client: 114.80.182.136, server: localhost, request: "GET /home/senior HTTP/1.1", upstream: "

    connect() to 192.168.30.71:8082 failed (99: Cannot assign requested address) while connecting to ups ...

  2. 解决Zabbix网页端Get value error: cannot connect to [[192.168.238.139]:10050]: [113] No route to host问题

    在安装配置完zabbix_agentd以后,网页端出现  Get value error: cannot connect to [[192.168.238.139]:10050]: [113] No ...

  3. ERROR 1130 (HY000): Host '192.168.20.165' is not allowed to connect to this MySQL server

    问题 远程连接mysql时遇到如下问题: ERROR 1130 (HY000): Host '192.168.20.165' is not allowed to connect to this MyS ...

  4. redis.exceptions.ConnectionError: Error 10061 connecting to 127.0.0.1:6379. 由于目标计算机积极拒绝,无法连接

    redis.exceptions.ConnectionError: Error 10061 connecting to 127.0.0.1:6379. 由于目标计算机积极拒绝,无法连接   是由于没有 ...

  5. Redis配置主从时报错“Could not connect to Redis at 192.168.0.50:6379: Connection refused not connected>”

    配置Redis主从时,修改完从节点配置文件,然后报错 [root@Rich七哥-0-50 redis]# /opt/redis/redis-cli -h 192.168.0.50 Could not ...

  6. socket.error: [Errno 99] Cannot assign requested address

    方法一:python 命令行下运行  vi /etc/hosts 将127.0.1.1 那一行的名字改成你的(用 vi /etc/hostname 获取) 127.0.0.1 localhost 12 ...

  7. [译]Python - socket.error: Cannot assign requested address

    原文来源: https://stackoverflow.com/questions/48306528/python-socket-error-cannot-assign-requested-addre ...

  8. 解决commBind: Cannot bind socket FD 18 to [::1]: (99) Cannot assign requested address squid

    最近玩squid主要是为了爬虫代理,但是使用docker搭建squid的时候发现,docker一直默认使用的 ipv6,但是squid使用ipv4,导致无法绑定,出现commBind: Cannot ...

  9. python socket编程腾讯云下报错[Errno 99] Cannot assign requested address的解决方式

    先写服务端server.py: import socket import time HOST = '172.17.xx.xx' #服务器的私网IP #HOST = 'localhost' PORT = ...

随机推荐

  1. Spring Boot 集成Angular程序

    假设 1.你已经完成了Spring Boot的示例,在浏览其中输入http://localhost:8080/index,能够返回html页面. 2.你已经完成了Angular程序,名字为quicks ...

  2. 开门人和关门人(结构体+sort)

    每天第一个到机房的人要把门打开,最后一个离开的人要把门关好.现有一堆杂乱的机房签 到.签离记录,请根据记录找出当天开门和关门的人.    Input 测试输入的第一行给出记录的总天数N ( > ...

  3. Saving James Bond - Hard Version

    07-图5 Saving James Bond - Hard Version(30 分) This time let us consider the situation in the movie &q ...

  4. Vue如何在webpack设置代理解决跨域问题

            在开发过程中我们请求数据有时候调用的是第三方接口,此时便会遇到一个问题:跨域限制.对于跨域问题的解释就不详细叙述了,要了解的请自行百度.一般跨域问题控制台会报这个错:         ...

  5. 【Codeforces 140A】New Year Table

    [链接] 我是链接,点我呀:) [题意] 题意 [题解] 算出来每个盘子要占用多少角度. 然后乘n看看是不是小于等于2π就好 (精度最好定在1e-7) [代码] #include <bits/s ...

  6. python006 Python3 运算符

    Python3 运算符什么是运算符?本章节主要说明Python的运算符.举个简单的例子 4 +5 = 9 . 例子中,4 和 5 被称为操作数,"+" 称为运算符.Python语言 ...

  7. POJ 1523 网络连通

    题目大意: 给你一个网络组,每台机子与其他机子的关系,让你找到所有的割点,如果没有割点,输出无 这道题目就是最直接的求割点问题,我在这里用的是邻接矩阵来存储机子之间的关系 割点问题的求解需要对深度优先 ...

  8. K/3Cloud二次开发基于WebDev附加进程调试

    大部分人在进行K/3cloud二次开发插件的调试时,选择的是附加IIS进程w3wp调试,本文给大家介绍一下基于WebDev附加进程调试,不用重启iis. 步骤如下: 1)拷贝K/3cloud产品安装目 ...

  9. BZOJ2038 (莫队)

    BZOJ2038: 小Z的袜子 Problem : N只袜子排成一排,每次询问一个区间内的袜子种随机拿两只袜子颜色相同的概率. Solution : 莫队算法真的是简单易懂又暴力. 莫队算法用来离线处 ...

  10. 安装redis和phpredis模块

    安装redis shell> wget http://redis.googlecode.com/files/redis-2.0.4.tar.gz shell> tar zxvf redis ...