gpt4 book ai didi

Java - 确切含义http.maxConnections

转载 作者:行者123 更新时间:2023-11-30 05:52:08 25 4
gpt4 key购买 nike

最近我遇到了 Oracle 提供的 java 属性 http.maxConnections 的 2 个略有不同的定义。

here它被定义为

If HTTP keepalive is enabled this value determines the maximum number of idle connections that will be simultaneously kept alive, per destination.

here它被定义为

Indicates the maximum number of connections per destination to be kept alive at any given time

令我困惑的是上面第一个定义中提到的词idle。考虑第一个定义,我的理解是该属性限制连接池中存在但未使用的连接数。这意味着无论此配置如何,我都可以同时运行指向同一端点的“无限”数量的 Activity 连接。如果我考虑上面的第二个定义(其中 Oracle 删除了 te 关键字),我就没有相同的理解闲置的。在最后这个属性中,似乎这个属性是为了限制一个端点的连接总数,所以如果我配置 http.maxConnections=10 ,我最多可以有 10 个对同一端点的同时调用。

有人可以解答我的疑惑吗?

谢谢!

(ps:为了完整起见,我对 Java8 行为感兴趣)

最佳答案

代码检查显示该属性仅用于限制保持 Activity 缓存的大小 - 因此除非我弄错了,否则这实际上是空闲连接的最大数量。

关于Java - 确切含义http.maxConnections,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53720957/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com