This is an automated email from the ASF dual-hosted git repository.
stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
The following commit(s) were added to refs/heads/master by this push:
new 43928b190 IMPALA-11617: Pool service should be made aware of cpu core
limit
43928b190 is described below
commit 43928b190bb86b2a9d7378292c5825d3a4aac5fc
Author: wzhou-code <[email protected]>
AuthorDate: Fri Oct 7 17:22:00 2022 -0700
IMPALA-11617: Pool service should be made aware of cpu core limit
IMPALA-11604 enables the planner to compute CPU usage for certain
queries and to select suitable executor groups to run. The CPU usage is
expressed as the CPU cores required to process a query.
This patch added the CPU core limit, which is the maximum CPU core
available per node and coordinator for each executor group, to the pool
service.
Testing:
- Passed core run.
- Verified that CPU cores were shown on the admission and
metrics pages of the Impala debug web server.
Change-Id: Id4c5ee519ce7c329b06ac821283e215a3560f525
Reviewed-on: http://gerrit.cloudera.org:8080/19366
Reviewed-by: Andrew Sherman <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
be/src/scheduling/admission-controller.cc | 17 ++++++++
be/src/scheduling/admission-controller.h | 2 +
common/thrift/Frontend.thrift | 13 ++++++
common/thrift/ImpalaInternalService.thrift | 12 ++++++
common/thrift/metrics.json | 20 +++++++++
docs/topics/impala_admission_config.xml | 8 ++++
.../java/org/apache/impala/service/Frontend.java | 9 ++++
.../org/apache/impala/util/RequestPoolService.java | 16 +++++++-
.../apache/impala/util/TestRequestPoolService.java | 13 ++++--
fe/src/test/resources/llama-site-2-groups.xml | 16 ++++++++
fe/src/test/resources/llama-site-test.xml | 8 ++++
fe/src/test/resources/llama-site-test2.xml | 8 ++++
.../test/resources/mem-limit-test-llama-site.xml | 48 ++++++++++++++++++++++
fe/src/test/resources/minicluster-llama-site.xml | 14 +++++++
tests/common/resource_pool_config.py | 5 ++-
tests/custom_cluster/test_executor_groups.py | 8 ++--
www/admission_controller.tmpl | 10 +++++
17 files changed, 217 insertions(+), 10 deletions(-)
diff --git a/be/src/scheduling/admission-controller.cc
b/be/src/scheduling/admission-controller.cc
index dc2b53e10..f0f68e00c 100644
--- a/be/src/scheduling/admission-controller.cc
+++ b/be/src/scheduling/admission-controller.cc
@@ -143,6 +143,10 @@ const string POOL_MIN_QUERY_MEM_LIMIT_METRIC_KEY_FORMAT =
"admission-controller.pool-min-query-mem-limit.$0";
const string POOL_CLAMP_MEM_LIMIT_QUERY_OPTION_METRIC_KEY_FORMAT =
"admission-controller.pool-clamp-mem-limit-query-option.$0";
+const string POOL_MAX_QUERY_CPU_CORE_PER_NODE_LIMIT_METRIC_KEY_FORMAT =
+ "admission-controller.pool-max-query-cpu-core-per-node-limit.$0";
+const string POOL_MAX_QUERY_CPU_CORE_COORDINATOR_LIMIT_METRIC_KEY_FORMAT =
+ "admission-controller.pool-max-query-cpu-core-coordinator-limit.$0";
// Profile info strings
const string AdmissionController::PROFILE_INFO_KEY_ADMISSION_RESULT =
"Admission result";
@@ -1186,6 +1190,10 @@ void
AdmissionController::PoolStats::UpdateConfigMetrics(const TPoolConfig& pool
metrics_.max_query_mem_limit->SetValue(pool_cfg.max_query_mem_limit);
metrics_.min_query_mem_limit->SetValue(pool_cfg.min_query_mem_limit);
metrics_.clamp_mem_limit_query_option->SetValue(pool_cfg.clamp_mem_limit_query_option);
+ metrics_.max_query_cpu_core_per_node_limit->SetValue(
+ pool_cfg.max_query_cpu_core_per_node_limit);
+ metrics_.max_query_cpu_core_coordinator_limit->SetValue(
+ pool_cfg.max_query_cpu_core_coordinator_limit);
}
Status AdmissionController::SubmitForAdmission(const AdmissionRequest& request,
@@ -2390,6 +2398,11 @@ void AdmissionController::PoolStats::ToJson(
document->GetAllocator());
pool->AddMember("clamp_mem_limit_query_option",
metrics_.clamp_mem_limit_query_option->GetValue(),
document->GetAllocator());
+ pool->AddMember("max_query_cpu_core_per_node_limit",
+ metrics_.max_query_cpu_core_per_node_limit->GetValue(),
document->GetAllocator());
+ pool->AddMember("max_query_cpu_core_coordinator_limit",
+ metrics_.max_query_cpu_core_coordinator_limit->GetValue(),
+ document->GetAllocator());
pool->AddMember("wait_time_ms_ema", wait_time_ms_ema_,
document->GetAllocator());
Value histogram(kArrayType);
for (int bucket = 0; bucket < peak_mem_histogram_.size(); bucket++) {
@@ -2474,6 +2487,10 @@ void AdmissionController::PoolStats::InitMetrics() {
POOL_MIN_QUERY_MEM_LIMIT_METRIC_KEY_FORMAT, 0, name_);
metrics_.clamp_mem_limit_query_option =
parent_->metrics_group_->AddProperty<bool>(
POOL_CLAMP_MEM_LIMIT_QUERY_OPTION_METRIC_KEY_FORMAT, false, name_);
+ metrics_.max_query_cpu_core_per_node_limit =
parent_->metrics_group_->AddGauge(
+ POOL_MAX_QUERY_CPU_CORE_PER_NODE_LIMIT_METRIC_KEY_FORMAT, 0, name_);
+ metrics_.max_query_cpu_core_coordinator_limit =
parent_->metrics_group_->AddGauge(
+ POOL_MAX_QUERY_CPU_CORE_COORDINATOR_LIMIT_METRIC_KEY_FORMAT, 0, name_);
}
void AdmissionController::PopulatePerHostMemReservedAndAdmitted(
diff --git a/be/src/scheduling/admission-controller.h
b/be/src/scheduling/admission-controller.h
index 758c92f05..20a40e11f 100644
--- a/be/src/scheduling/admission-controller.h
+++ b/be/src/scheduling/admission-controller.h
@@ -544,6 +544,8 @@ class AdmissionController {
IntGauge* max_query_mem_limit;
IntGauge* min_query_mem_limit;
BooleanProperty* clamp_mem_limit_query_option;
+ IntGauge* max_query_cpu_core_per_node_limit;
+ IntGauge* max_query_cpu_core_coordinator_limit;
};
PoolStats(AdmissionController* parent, const std::string& name)
diff --git a/common/thrift/Frontend.thrift b/common/thrift/Frontend.thrift
index d4aa0104a..77408ba6f 100644
--- a/common/thrift/Frontend.thrift
+++ b/common/thrift/Frontend.thrift
@@ -772,6 +772,19 @@ struct TExecutorGroupSet {
// the frontend computes the per host estimated-memory after a compilation
with a
// number of executor nodes from this group set and compares it with this
variable.
4: optional i64 max_mem_limit
+
+ // The optional num_cores_per_executor is used to determine which executor
group set to
+ // run for a query. The num_cores_per_executor value is set to
+ // max_query_cpu_core_per_node_limit attribute of the group set with name
prefix
+ // 'exec_group_name_prefix' from the pool service.
+ // The total number of CPU cores among all executors in this executor group
equals
+ // num_cores_per_executor * curr_num_executors if curr_num_executors is
greater than 0,
+ // otherwise it equals num_cores_per_executor * expected_num_executors.
+ // For each query, the frontend computes the estimated total CPU core count
required
+ // for a query to run efficiently after a compilation with a number of
executor nodes
+ // from this group set and compare it with the total number of CPU cores in
this
+ // executor group.
+ 5: optional i32 num_cores_per_executor
}
// Sent from the impalad BE to FE with the latest membership snapshot of the
diff --git a/common/thrift/ImpalaInternalService.thrift
b/common/thrift/ImpalaInternalService.thrift
index 1f95d7284..577a6b0a6 100644
--- a/common/thrift/ImpalaInternalService.thrift
+++ b/common/thrift/ImpalaInternalService.thrift
@@ -195,6 +195,18 @@ struct TPoolConfig {
// maximum, the mt_dop setting is reduced to the maximum. If the max_mt_dop
is
// negative, no limit is enforced.
9: required i64 max_mt_dop = -1;
+
+ // Maximum CPU cores per node for processing a query.
+ // Typically it should be set with the value less than or equal to the
number of cores
+ // of the executor nodes.
+ // 0 indicates no limit. Default value is set as 0.
+ 10: required i64 max_query_cpu_core_per_node_limit = 0;
+
+ // Maximum CPU cores on coordinator for processing a query.
+ // Typically it should be set with the value less than or equal to the
number of cores
+ // of the coordinators.
+ // 0 indicates no limit. Default value is set as 0.
+ 11: required i64 max_query_cpu_core_coordinator_limit = 0;
}
struct TParseDateStringResult {
diff --git a/common/thrift/metrics.json b/common/thrift/metrics.json
index 7188d75aa..5f1a68e71 100644
--- a/common/thrift/metrics.json
+++ b/common/thrift/metrics.json
@@ -149,6 +149,26 @@
"kind": "PROPERTY",
"key": "admission-controller.pool-clamp-mem-limit-query-option.$0"
},
+ {
+ "description": "Resource Pool $0 Max Query CPU Core Per Node Limit",
+ "contexts": [
+ "RESOURCE_POOL"
+ ],
+ "label": "Resource Pool $0 Max Query CPU Core Per Node Limit",
+ "units": "UNIT",
+ "kind": "GAUGE",
+ "key": "admission-controller.pool-max-query-cpu-core-per-node-limit.$0"
+ },
+ {
+ "description": "Resource Pool $0 Max Query CPU Core Coordinator Limit",
+ "contexts": [
+ "RESOURCE_POOL"
+ ],
+ "label": "Resource Pool $0 Max Query CPU Core Coordinator Limit",
+ "units": "UNIT",
+ "kind": "GAUGE",
+ "key": "admission-controller.pool-max-query-cpu-core-coordinator-limit.$0"
+ },
{
"description": "Resource Pool $0 Aggregate Queue Size",
"contexts": [
diff --git a/docs/topics/impala_admission_config.xml
b/docs/topics/impala_admission_config.xml
index 5b6ecf5de..d7b000ef3 100644
--- a/docs/topics/impala_admission_config.xml
+++ b/docs/topics/impala_admission_config.xml
@@ -224,6 +224,14 @@
impala.admission-control.pool-queue-timeout-ms.<varname>queue_name</varname></ph
<name>impala.admission-control.<b>clamp-mem-limit-query-option</b>.root.default.regularPool</name>
<value>true</value>
</property>
+ <property>
+
<name>impala.admission-control.<b>max-query-cpu-core-per-node-limit</b>.root.default.regularPool</name>
+ <value>8</value>
+ </property>
+ <property>
+
<name>impala.admission-control.<b>max-query-cpu-core-coordinator-limit</b>.root.default.regularPool</name>
+ <value>8</value>
+ </property>
</configuration>
</codeblock>
diff --git a/fe/src/main/java/org/apache/impala/service/Frontend.java
b/fe/src/main/java/org/apache/impala/service/Frontend.java
index df89ce079..a261f87ef 100644
--- a/fe/src/main/java/org/apache/impala/service/Frontend.java
+++ b/fe/src/main/java/org/apache/impala/service/Frontend.java
@@ -1828,6 +1828,7 @@ public class Frontend {
result.add(new TExecutorGroupSet(e));
result.get(0).setCurr_num_executors(e.getExpected_num_executors());
result.get(0).setMax_mem_limit(Long.MAX_VALUE);
+ result.get(0).setNum_cores_per_executor(Integer.MAX_VALUE);
} else if (test_replan) {
ExecutorMembershipSnapshot cluster =
ExecutorMembershipSnapshot.getCluster();
int num_nodes = cluster.numExecutors();
@@ -1837,6 +1838,7 @@ public class Frontend {
TExecutorGroupSet s = new TExecutorGroupSet(e);
s.setExec_group_name_prefix("small");
s.setMax_mem_limit(64*MEGABYTE);
+ s.setNum_cores_per_executor(8);
result.add(s);
TExecutorGroupSet l = new TExecutorGroupSet(e);
String newName = "large";
@@ -1846,11 +1848,13 @@ public class Frontend {
}
l.setExec_group_name_prefix(newName);
l.setMax_mem_limit(Long.MAX_VALUE);
+ l.setNum_cores_per_executor(Integer.MAX_VALUE);
result.add(l);
} else {
// Copy and augment the group with the maximally allowed max_mem_limit
value.
result.add(new TExecutorGroupSet(e));
result.get(0).setMax_mem_limit(Long.MAX_VALUE);
+ result.get(0).setNum_cores_per_executor(Integer.MAX_VALUE);
}
return result;
}
@@ -1859,6 +1863,7 @@ public class Frontend {
if (executorGroupSets.size() == 0) {
result.add(new TExecutorGroupSet(1, 20, DEFAULT_POOL_NAME));
result.get(0).setMax_mem_limit(Long.MAX_VALUE);
+ result.get(0).setNum_cores_per_executor(Integer.MAX_VALUE);
return result;
}
@@ -1879,9 +1884,13 @@ public class Frontend {
Preconditions.checkNotNull(poolConfig);
new_entry.setMax_mem_limit(poolConfig.getMax_query_mem_limit() > 0 ?
poolConfig.getMax_query_mem_limit() : Long.MAX_VALUE);
+ new_entry.setNum_cores_per_executor(
+ poolConfig.getMax_query_cpu_core_per_node_limit() > 0 ?
+ (int)poolConfig.getMax_query_cpu_core_per_node_limit() :
Integer.MAX_VALUE);
} else {
// Set to max possible threshold value when there is no pool service
new_entry.setMax_mem_limit(Long.MAX_VALUE);
+ new_entry.setNum_cores_per_executor(Integer.MAX_VALUE);
}
result.add(new_entry);
}
diff --git a/fe/src/main/java/org/apache/impala/util/RequestPoolService.java
b/fe/src/main/java/org/apache/impala/util/RequestPoolService.java
index 828fe3792..68cacaa19 100644
--- a/fe/src/main/java/org/apache/impala/util/RequestPoolService.java
+++ b/fe/src/main/java/org/apache/impala/util/RequestPoolService.java
@@ -123,6 +123,12 @@ public class RequestPoolService {
// Key for specifying the "Max mt_dop" configuration of the pool
private final static String MAX_MT_DOP =
"impala.admission-control.max-mt-dop";
+ // Keys for the pool max query cpu core per node and coordinator
respectively.
+ private final static String MAX_QUERY_CPU_CORE_PER_NODE_LIMIT =
+ "impala.admission-control.max-query-cpu-core-per-node-limit";
+ private final static String MAX_QUERY_CPU_CORE_COORDINATOR_LIMIT =
+ "impala.admission-control.max-query-cpu-core-coordinator-limit";
+
// String format for a per-pool configuration key. First parameter is the
key for the
// default, e.g. MAX_PLACED_RESERVATIONS_KEY, and the second parameter is the
// pool name.
@@ -388,16 +394,22 @@ public class RequestPoolService {
getPoolConfigValue(currentConf, pool, CLAMP_MEM_LIMIT_QUERY_OPTION,
true));
result.setMax_mt_dop(
getPoolConfigValue(currentConf, pool, MAX_MT_DOP, -1));
+ result.setMax_query_cpu_core_per_node_limit(
+ getPoolConfigValue(currentConf, pool,
MAX_QUERY_CPU_CORE_PER_NODE_LIMIT, 0L));
+ result.setMax_query_cpu_core_coordinator_limit(getPoolConfigValue(
+ currentConf, pool, MAX_QUERY_CPU_CORE_COORDINATOR_LIMIT, 0L));
}
if (LOG.isTraceEnabled()) {
LOG.debug("getPoolConfig(pool={}): max_mem_resources={},
max_requests={},"
+ " max_queued={}, queue_timeout_ms={},
default_query_options={},"
+ " max_query_mem_limit={}, min_query_mem_limit={},"
- + " clamp_mem_limit_query_option={}",
+ + " clamp_mem_limit_query_option={},
max_query_cpu_core_per_node_limit={},"
+ + " max_query_cpu_core_coordinator_limit={}",
pool, result.max_mem_resources, result.max_requests,
result.max_queued,
result.queue_timeout_ms, result.default_query_options,
result.max_query_mem_limit, result.min_query_mem_limit,
- result.clamp_mem_limit_query_option);
+ result.clamp_mem_limit_query_option,
result.max_query_cpu_core_per_node_limit,
+ result.max_query_cpu_core_coordinator_limit);
}
return result;
}
diff --git
a/fe/src/test/java/org/apache/impala/util/TestRequestPoolService.java
b/fe/src/test/java/org/apache/impala/util/TestRequestPoolService.java
index efc9412ab..c66defa96 100644
--- a/fe/src/test/java/org/apache/impala/util/TestRequestPoolService.java
+++ b/fe/src/test/java/org/apache/impala/util/TestRequestPoolService.java
@@ -205,7 +205,7 @@ public class TestRequestPoolService {
10000L, "mem_limit=1024m,query_timeout_s=10");
checkPoolConfigResult("root.queueB", 5, 10, -1, 30000L, "mem_limit=1024m");
checkPoolConfigResult("root.queueC", 5, 10, 1024 * ByteUnits.MEGABYTE,
30000L,
- "mem_limit=1024m", 1000, 10, false);
+ "mem_limit=1024m", 1000, 10, false, 8, 8);
}
@Test
@@ -213,7 +213,7 @@ public class TestRequestPoolService {
createPoolService(ALLOCATION_FILE_EMPTY, LLAMA_CONFIG_FILE_EMPTY);
Assert.assertEquals("root.userA", poolService_.assignToPool("", "userA"));
Assert.assertTrue(poolService_.hasAccess("root.userA", "userA"));
- checkPoolConfigResult("root", -1, 200, -1, null, "", 0, 0, true);
+ checkPoolConfigResult("root", -1, 200, -1, null, "", 0, 0, true, 0, 0);
}
@Ignore("IMPALA-4868") @Test
@@ -309,7 +309,8 @@ public class TestRequestPoolService {
private void checkPoolConfigResult(String pool, long expectedMaxRequests,
long expectedMaxQueued, long expectedMaxMem, Long expectedQueueTimeoutMs,
String expectedQueryOptions, long max_query_mem_limit, long
min_query_mem_limit,
- boolean clamp_mem_limit_query_option) {
+ boolean clamp_mem_limit_query_option, long
max_query_cpu_core_per_node_limit,
+ long max_query_cpu_core_coordinator_limit) {
TPoolConfig expectedResult = new TPoolConfig();
expectedResult.setMax_requests(expectedMaxRequests);
expectedResult.setMax_queued(expectedMaxQueued);
@@ -317,6 +318,10 @@ public class TestRequestPoolService {
expectedResult.setMax_query_mem_limit(max_query_mem_limit);
expectedResult.setMin_query_mem_limit(min_query_mem_limit);
expectedResult.setClamp_mem_limit_query_option(clamp_mem_limit_query_option);
+ expectedResult.setMax_query_cpu_core_per_node_limit(
+ max_query_cpu_core_per_node_limit);
+ expectedResult.setMax_query_cpu_core_coordinator_limit(
+ max_query_cpu_core_coordinator_limit);
if (expectedQueueTimeoutMs != null) {
expectedResult.setQueue_timeout_ms(expectedQueueTimeoutMs);
}
@@ -331,7 +336,7 @@ public class TestRequestPoolService {
long expectedMaxQueued, long expectedMaxMem, Long expectedQueueTimeoutMs,
String expectedQueryOptions) {
checkPoolConfigResult(pool, expectedMaxRequests, expectedMaxQueued,
expectedMaxMem,
- expectedQueueTimeoutMs, expectedQueryOptions, 0, 0, true);
+ expectedQueueTimeoutMs, expectedQueryOptions, 0, 0, true, 0, 0);
}
private void checkPoolConfigResult(String pool, long expectedMaxRequests,
diff --git a/fe/src/test/resources/llama-site-2-groups.xml
b/fe/src/test/resources/llama-site-2-groups.xml
index 1a48a847c..f06b35a28 100644
--- a/fe/src/test/resources/llama-site-2-groups.xml
+++ b/fe/src/test/resources/llama-site-2-groups.xml
@@ -23,6 +23,14 @@
<!-- 0MB -->
<value>0</value>
</property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.small</name>
+ <value>8</value>
+ </property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.small</name>
+ <value>8</value>
+ </property>
<property>
<name>impala.admission-control.max-query-mem-limit.root.large</name>
<!-- 8 PB -->
@@ -33,4 +41,12 @@
<!-- 64MB+1 -->
<value>67108865</value>
</property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.large</name>
+ <value>64</value>
+ </property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.large</name>
+ <value>64</value>
+ </property>
</configuration>
diff --git a/fe/src/test/resources/llama-site-test.xml
b/fe/src/test/resources/llama-site-test.xml
index 373870516..49ec107f5 100644
--- a/fe/src/test/resources/llama-site-test.xml
+++ b/fe/src/test/resources/llama-site-test.xml
@@ -55,4 +55,12 @@
<name>impala.admission-control.clamp-mem-limit-query-option.root.queueC</name>
<value>false</value>
</property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.queueC</name>
+ <value>8</value>
+ </property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.queueC</name>
+ <value>8</value>
+ </property>
</configuration>
diff --git a/fe/src/test/resources/llama-site-test2.xml
b/fe/src/test/resources/llama-site-test2.xml
index 8890d994d..045b72828 100644
--- a/fe/src/test/resources/llama-site-test2.xml
+++ b/fe/src/test/resources/llama-site-test2.xml
@@ -65,6 +65,14 @@
<name>impala.admission-control.min-query-mem-limit.root.queueD</name>
<value>10</value>
</property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.queueD</name>
+ <value>8</value>
+ </property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.queueD</name>
+ <value>8</value>
+ </property>
<property>
<name>llama.am.throttling.maximum.placed.reservations.root.queueD</name>
<value>6</value>
diff --git a/fe/src/test/resources/mem-limit-test-llama-site.xml
b/fe/src/test/resources/mem-limit-test-llama-site.xml
index 2c4838838..e80758e7f 100644
--- a/fe/src/test/resources/mem-limit-test-llama-site.xml
+++ b/fe/src/test/resources/mem-limit-test-llama-site.xml
@@ -13,6 +13,14 @@
<name>impala.admission-control.clamp-mem-limit-query-option.root.regularPoolWithoutClamping</name>
<value>false</value>
</property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.regularPoolWithoutClamping</name>
+ <value>8</value>
+ </property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.regularPoolWithoutClamping</name>
+ <value>8</value>
+ </property>
<!--poolLowMinLimit pool config-->
<property>
<name>impala.admission-control.min-query-mem-limit.root.poolLowMinLimit</name>
@@ -36,6 +44,14 @@
<name>impala.admission-control.clamp-mem-limit-query-option.root.regularPool</name>
<value>true</value>
</property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.regularPool</name>
+ <value>8</value>
+ </property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.regularPool</name>
+ <value>8</value>
+ </property>
<!--regularPoolNoMinLimit pool config-->
<property>
<name>impala.admission-control.max-query-mem-limit.root.regularPoolNoMinLimit</name>
@@ -49,6 +65,14 @@
<name>impala.admission-control.clamp-mem-limit-query-option.root.regularPoolNoMinLimit</name>
<value>true</value>
</property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.regularPoolNoMinLimit</name>
+ <value>8</value>
+ </property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.regularPoolNoMinLimit</name>
+ <value>8</value>
+ </property>
<!--poolNoMemLimits pool config-->
<property>
<name>impala.admission-control.max-query-mem-limit.root.poolNoMemLimits</name>
@@ -58,6 +82,14 @@
<name>impala.admission-control.min-query-mem-limit.root.poolNoMemLimits</name>
<value>0</value>
</property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.poolNoMemLimits</name>
+ <value>8</value>
+ </property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.poolNoMemLimits</name>
+ <value>8</value>
+ </property>
<!--maxLessThanMinLimit pool config-->
<property>
<name>impala.admission-control.max-query-mem-limit.root.maxLessThanMinLimit</name>
@@ -67,6 +99,14 @@
<name>impala.admission-control.min-query-mem-limit.root.maxLessThanMinLimit</name>
<value>100001</value>
</property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.maxLessThanMinLimit</name>
+ <value>0</value>
+ </property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.maxLessThanMinLimit</name>
+ <value>0</value>
+ </property>
<!--maxMemLessThanMinLimit pool config-->
<property>
<name>impala.admission-control.min-query-mem-limit.root.maxMemLessThanMinLimit</name>
@@ -81,6 +121,14 @@
<name>impala.admission-control.min-query-mem-limit.root.invalidTestPool</name>
<value>26214400</value>
</property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.invalidTestPool</name>
+ <value>0</value>
+ </property>
+ <property>
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.invalidTestPool</name>
+ <value>0</value>
+ </property>
<property>
<name>llama.am.throttling.maximum.placed.reservations.root.invalidTestPool</name>
<value>1</value>
diff --git a/fe/src/test/resources/minicluster-llama-site.xml
b/fe/src/test/resources/minicluster-llama-site.xml
index affc9a484..0aedb164e 100644
--- a/fe/src/test/resources/minicluster-llama-site.xml
+++ b/fe/src/test/resources/minicluster-llama-site.xml
@@ -19,6 +19,20 @@
<name>impala.admission-control.clamp-mem-limit-query-option.root.default</name>
<value>false</value>
</property>
+ <property>
+ <!-- Max cpu core per node given to queries by default. This will allow
+ running one large query and multiple small queries on a typical
+ minicluster where each impalad has ~7gb of memory. -->
+
<name>impala.admission-control.max-query-cpu-core-per-node-limit.root.default</name>
+ <value>16</value>
+ </property>
+ <property>
+ <!-- Max cpu core on coordinator given to queries by default. This will
allow
+ running one large query and multiple small queries on a typical
+ minicluster where each impalad has ~7gb of memory. -->
+
<name>impala.admission-control.max-query-cpu-core-coordinator-limit.root.default</name>
+ <value>16</value>
+ </property>
<!-- We need to increase the pool queue timeout to avoid flakiness from
queries
getting stuck behind queries from other tests and timed out. Set to a
very high value to avoid failures unless queries are genuinely stuck.
-->
diff --git a/tests/common/resource_pool_config.py
b/tests/common/resource_pool_config.py
index ad18c5916..9347b7e9d 100644
--- a/tests/common/resource_pool_config.py
+++ b/tests/common/resource_pool_config.py
@@ -29,7 +29,10 @@ class ResourcePoolConfig(object):
# Mapping of config strings used in the llama_site file with those used on
the impala
# metrics debug page. Add to this dictionary if other configs are need for
tests.
- CONFIG_TO_METRIC_STR_MAPPING = {'max-query-mem-limit':
'pool-max-query-mem-limit'}
+ CONFIG_TO_METRIC_STR_MAPPING = {
+ 'max-query-mem-limit': 'pool-max-query-mem-limit',
+ 'max-query-cpu-core-per-node-limit':
'pool-max-query-cpu-core-per-node-limit',
+ 'max-query-cpu-core-coordinator-limit':
'pool-max-query-cpu-core-coordinator-limit'}
"""'impala_service' should point to an impalad to be used for running
queries.
'ac_service' should point to the service running the admission controller
and is used
diff --git a/tests/custom_cluster/test_executor_groups.py
b/tests/custom_cluster/test_executor_groups.py
index da24e6f87..e66146b38 100644
--- a/tests/custom_cluster/test_executor_groups.py
+++ b/tests/custom_cluster/test_executor_groups.py
@@ -698,9 +698,11 @@ class TestExecutorGroups(CustomClusterTestSuite):
"resources")
# Define two group sets: small and large
fs_allocation_path = os.path.join(RESOURCES_DIR,
"fair-scheduler-2-groups.xml")
- # Define the min-query-mem-limit and max-query-mem-limit properties of the
two sets:
- # small: [0, 64MB]
- # large: [64MB+1Byte, 8PB]
+ # Define the min-query-mem-limit, max-query-mem-limit,
+ # max-query-cpu-core-per-node-limit and
max-query-cpu-core-coordinator-limit
+ # properties of the two sets:
+ # small: [0, 64MB, 8, 8]
+ # large: [64MB+1Byte, 8PB, 64, 64]
llama_site_path = os.path.join(RESOURCES_DIR, "llama-site-2-groups.xml")
# Start with a regular admission config with multiple pools and no
resource limits.
self._restart_coordinators(num_coordinators=1,
diff --git a/www/admission_controller.tmpl b/www/admission_controller.tmpl
index b51c3dab1..a78f77279 100644
--- a/www/admission_controller.tmpl
+++ b/www/admission_controller.tmpl
@@ -36,6 +36,8 @@ Example of json received from the impala server
"max_query_mem_limit": 0,
"min_query_mem_limit": 0,
"clamp_mem_limit_query_option": true,
+ "max_query_cpu_core_per_node_limit": 8,
+ "max_query_cpu_core_coordinator_limit": 8,
"wait_time_ms_EMA": 0.0,
"histogram": [
[
@@ -261,6 +263,14 @@ Time since last statestore update containing admission
control topic state (ms):
<td>Clamp MEM_LIMIT query option</td>
<td>{{clamp_mem_limit_query_option}}</td>
</tr>
+ <tr>
+ <td>Query CPU core per node</td>
+ <td>{{max_query_cpu_core_per_node_limit}}</td>
+ </tr>
+ <tr>
+ <td>Query CPU core on coordinator</td>
+ <td>{{max_query_cpu_core_coordinator_limit}}</td>
+ </tr>
</table>
<h4>Queued queries in order of being queued (submitted to this
coordinator)</h4>