Skip to content

Commit 63c765e

Browse files
authored
Merge pull request #31203 from vespa-engine/jonmv/less-aggressive-smoothing
Less aggressive smoothing, and readjust a bit less often
2 parents cf84c1d + 34a1fe4 commit 63c765e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

client/go/internal/vespa/document/throttler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func NewThrottler(connections int) Throttler { return newThrottler(connections,
5959
func (t *dynamicThrottler) Sent() {
6060
currentInflight := t.TargetInflight()
6161
t.sent++
62-
if t.sent*t.sent*t.sent < 100*currentInflight*currentInflight {
62+
if t.sent*t.sent*t.sent < 1000*currentInflight*currentInflight {
6363
return
6464
}
6565
t.sent = 0
@@ -94,7 +94,7 @@ func (t *dynamicThrottler) Sent() {
9494
if j != -1 {
9595
u := t.throughputs[j]
9696
if k != -1 {
97-
t.throughputs[j] = (2*u + t.throughputs[i] + s) / 4
97+
t.throughputs[j] = (18*u + t.throughputs[i] + s) / 20
9898
}
9999
s = u
100100
}

client/go/internal/vespa/document/throttler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func TestThrottler(t *testing.T) {
1313
if got, want := tr.TargetInflight(), int64(16); got != want {
1414
t.Errorf("got TargetInflight() = %d, but want %d", got, want)
1515
}
16-
for i := 0; i < 30; i++ {
16+
for i := 0; i < 65; i++ {
1717
tr.Sent()
1818
tr.Success()
1919
}

vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/DynamicThrottler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public DynamicThrottler(FeedClientBuilderImpl builder) {
3434
@Override
3535
public void sent(long __, CompletableFuture<HttpResponse> ___) {
3636
double currentInflight = targetInflight();
37-
if (++sent * sent * sent < 1e2 * currentInflight * currentInflight)
37+
if (++sent * sent * sent < 1e3 * currentInflight * currentInflight)
3838
return;
3939

4040
sent = 0;
@@ -63,7 +63,7 @@ public void sent(long __, CompletableFuture<HttpResponse> ___) {
6363
// Additionally, smooth the throughput values, to reduce the impact of noise, and reduce jumpiness.
6464
if (j != -1) {
6565
double t = throughputs[j];
66-
if (k != -1) throughputs[j] = (2 * t + throughputs[i] + s) / 4;
66+
if (k != -1) throughputs[j] = (18 * t + throughputs[i] + s) / 20;
6767
s = t;
6868
}
6969
k = j;

vespa-feed-client/src/test/java/ai/vespa/feed/client/impl/DynamicThrottlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void testThrottler() {
1717
DynamicThrottler throttler = new DynamicThrottler(new FeedClientBuilderImpl(List.of(URI.create("http://localhost:8080"))));
1818
assertEquals(16, throttler.targetInflight());
1919

20-
for (int i = 0; i < 30; i++) {
20+
for (int i = 0; i < 65; i++) {
2121
throttler.sent(1, null);
2222
throttler.success();
2323
}

0 commit comments

Comments
 (0)