Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/changelog/115041.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 115041
summary: Increase default `queue_capacity` to 10_000 and decrease max `queue_capacity`
to 100_000
area: Machine Learning
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class StartTrainedModelDeploymentAction extends ActionType<CreateTrainedM
public static final AllocationStatus.State DEFAULT_WAITFOR_STATE = AllocationStatus.State.STARTED;
public static final int DEFAULT_NUM_ALLOCATIONS = 1;
public static final int DEFAULT_NUM_THREADS = 1;
public static final int DEFAULT_QUEUE_CAPACITY = 1024;
public static final int DEFAULT_QUEUE_CAPACITY = 10_000;
public static final Priority DEFAULT_PRIORITY = Priority.NORMAL;

public StartTrainedModelDeploymentAction() {
Expand All @@ -89,7 +89,7 @@ public static class Request extends MasterNodeRequest<Request> implements ToXCon
/**
* If the queue is created then we can OOM when we create the queue.
*/
private static final int MAX_QUEUE_CAPACITY = 1_000_000;
private static final int MAX_QUEUE_CAPACITY = 100_000;

public static final ParseField MODEL_ID = new ParseField("model_id");
public static final ParseField DEPLOYMENT_ID = new ParseField("deployment_id");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static Request createRandom() {
request.setNumberOfAllocations(randomIntBetween(1, 8));
}
if (randomBoolean()) {
request.setQueueCapacity(randomIntBetween(1, 1000000));
request.setQueueCapacity(randomIntBetween(1, 100_000));
}
if (randomBoolean()) {
request.setPriority(randomFrom(Priority.values()).toString());
Expand Down Expand Up @@ -168,7 +168,7 @@ public void testValidate_GivenQueueCapacityIsNegative() {

public void testValidate_GivenQueueCapacityIsAtLimit() {
Request request = createRandom();
request.setQueueCapacity(1_000_000);
request.setQueueCapacity(100_000);

ActionRequestValidationException e = request.validate();

Expand All @@ -177,12 +177,12 @@ public void testValidate_GivenQueueCapacityIsAtLimit() {

public void testValidate_GivenQueueCapacityIsOverLimit() {
Request request = createRandom();
request.setQueueCapacity(1_000_001);
request.setQueueCapacity(100_001);

ActionRequestValidationException e = request.validate();

assertThat(e, is(not(nullValue())));
assertThat(e.getMessage(), containsString("[queue_capacity] must be less than 1000000"));
assertThat(e.getMessage(), containsString("[queue_capacity] must be less than 100000"));
}

public void testValidate_GivenTimeoutIsNegative() {
Expand Down Expand Up @@ -234,6 +234,6 @@ public void testDefaults() {
assertThat(request.getNumberOfAllocations(), nullValue());
assertThat(request.computeNumberOfAllocations(), equalTo(1));
assertThat(request.getThreadsPerAllocation(), equalTo(1));
assertThat(request.getQueueCapacity(), equalTo(1024));
assertThat(request.getQueueCapacity(), equalTo(10_000));
}
}
Loading