aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-12-09 14:49:09 +0100
committerjonmv <venstad@gmail.com>2022-12-09 14:49:09 +0100
commitec58c2bc5e00fd972bc3bc72849b135c251cef3e (patch)
treeb85475d8d70e53077d7ccc40284ae00f60180afc /vespa-feed-client
parent0f15b405cad738460a8126bf9ef689ec3edfd094 (diff)
Limit max inflight from outside apache client
Diffstat (limited to 'vespa-feed-client')
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/StaticThrottler.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/StaticThrottler.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/StaticThrottler.java
index 1f9cf8e5155..9e7f868e346 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/StaticThrottler.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/StaticThrottler.java
@@ -21,8 +21,8 @@ public class StaticThrottler implements Throttler {
private final AtomicLong targetX10;
public StaticThrottler(FeedClientBuilderImpl builder) {
- minInflight = 16L * builder.connectionsPerEndpoint * builder.endpoints.size();
- maxInflight = 256 * minInflight; // 4096 max streams per connection on the server side.
+ minInflight = min(16L, builder.maxStreamsPerConnection) * builder.connectionsPerEndpoint * builder.endpoints.size();
+ maxInflight = (long) builder.maxStreamsPerConnection * builder.connectionsPerEndpoint * builder.endpoints.size();
targetX10 = new AtomicLong(10 * maxInflight); // 10x the actual value to allow for smaller updates.
}