urllib3 connectionpool - Connection pool is full, discarding connection(urllib3 connectionpool - 连接池已满,丢弃连接)
问题描述
看到了
urllib3.connectionpool WARNING - Connection pool is full, discarding connection
意味着我实际上正在丢失数据(因为失去连接)
或
是否意味着连接被丢弃(因为池已满);但是,当连接池可用时,稍后会重新尝试相同的连接?
mean that I am effectively loosing data (because of lost connection)
OR
Does it mean that connection is dropped (because pool is full); however, the same connection will be re-tried later on when connection pool becomes available?
推荐答案
没有数据丢失!
连接被丢弃在请求完成后(因为池已满,如前所述).这意味着这个特定的连接将来不会被重复使用.
The connection is being discarded after the request is completed (because the pool is full, as mentioned). This means that this particular connection is not going to be re-used in the future.
由于 urllib3 PoolManager 重用连接,它会限制每个主机保留的连接数,以避免累积太多未使用的套接字.PoolManager 可以配置为避免在池没有任何可用的空闲套接字时创建过多的套接字 PoolManager(..., block=True)
.
Because a urllib3 PoolManager reuses connections, it will limit how many connections are retained per hos to avoid accumulating too many unused sockets. The PoolManager can be configured to avoid creating excess sockets when the pool doesn't have any idle sockets available with PoolManager(..., block=True)
.
如果您依赖并发,最好将池的大小增加 (maxsize
) 至少与数字一样大您正在使用的线程数,以便每个线程有效地获得自己的连接.
If you're relying on concurrency, it could be a good idea to increase the size of the pool (maxsize
) to be at least as large as the number of threads you're using, so that each thread effectively gets its own connection.
更多详情:https://urllib3.readthedocs.io/en/latest/advanced-usage.html#customizing-pool-behavior
这篇关于urllib3 connectionpool - 连接池已满,丢弃连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:urllib3 connectionpool - 连接池已满,丢弃连接


基础教程推荐
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 包装空间模型 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01