Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes on memory limit #119

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion markdown/reference/catalog/pg_resqueue.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The `pg_resqueue` system catalog table contains information about HAWQ resource
| `rsqname` | name |   | The name of the resource queue. |
| `parentoid` | oid |   | OID of the parent queue of the resource queue. |
| `activestats` | integer |   | The maximum number of parallel active statements allowed for the resource queue. |
| `memorylimit` | text |   | The maximum amount of memory that can be consumed by the resource queue (expressed as a percentage of the cluster's memory.) |
| `memorylimit` | text |   | The maximum amount of memory that can be consumed by the resource queue (expressed as a percentage of the cluster's memory.) Because of how memory is determined, the memory limit is not an upper limit on the memory actually used by a resource queue. |
| `corelimit` | text |   | The maximum amount of cores that can be consumed by the resource queue (expressed as a percentage of the cluster's cores.) |
| `resovercommit` | real |   | The ratio of resource consumption overcommit for the resource queue. |
| `allocpolicy` | text |   | The resource allocation policy name for the resource queue. |
Expand Down
4 changes: 3 additions & 1 deletion markdown/reference/sql/CREATE-RESOURCE-QUEUE.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Resource queues with an `ACTIVE_STATEMENTS` threshold set a maximum limit on the

When creating the resource queue, use the MEMORY\_LIMIT\_CLUSTER and CORE\_LIMIT\_CLUSTER queue attributes to tune the allowed resource usage of the resource queue. MEMORY\_LIMIT\_CLUSTER and CORE\_LIMIT\_CLUSTER must set to the same value for a resource queue. In addition the sum of the percentages of MEMORY\_LIMIT\_CLUSTER (and CORE\_LIMIT\_CLUSTER) for resource queues that share the same parent cannot exceed 100%.

Note: The MEMORY\_LIMIT of a resource queue assigns the quota to operators in a query plan during planning, before actual execution. Actual memory consumption during query might exceed the limit.

You can optionally configure the maximum or minimum number of virtual segments to use when executing a query by setting NVSEG\_UPPER\_LIMIT/NVSEG\_LOWER\_LIMIT or NVSEG\_UPPER\_LIMIT\_PERSEG/NVSEG\_LOWER\_LIMIT\_PERSEG attributes for the resource queue.

After defining a resource queue, you can assign a role to the queue by using the [ALTER ROLE](ALTER-ROLE.html) or [CREATE ROLE](CREATE-ROLE.html) command. You can only assign roles to the leaf-level resource queues (resource queues that do not have any children.)
Expand All @@ -75,7 +77,7 @@ See also [Best Practices for Using Resource Queues](../../bestpractices/managing
The parent queue cannot have any roles assigned.</dd>

<dt>MEMORY\_LIMIT\_CLUSTER=\<percentage\> </dt>
<dd>Required. Defines how much memory a resource queue can consume from its parent resource queue and consequently dispatch to the execution of parallel statements. Since a resource queue obtains its memory from its parent, the actual memory limit is based from its parent queue. The valid values are 1% to 100%. The value of MEMORY\_ LIMIT\_CLUSTER must be identical to the value of CORE\_LIMIT\_CLUSTER. The sum of values for MEMORY\_LIMIT\_CLUSTER of this queue plus other queues that share the same parent cannot exceed 100%. The HAWQ resource manager periodically validates this restriction.</dd>
<dd>Required. Defines how much memory a resource queue can consume from its parent resource queue and consequently dispatch to the execution of parallel statements. Since a resource queue obtains its memory from its parent, the actual memory limit is based from its parent queue. The valid values are 1% to 100%. The value of MEMORY\_ LIMIT\_CLUSTER must be identical to the value of CORE\_LIMIT\_CLUSTER. The sum of values for MEMORY\_LIMIT\_CLUSTER of this queue plus other queues that share the same parent cannot exceed 100%. The HAWQ resource manager periodically validates this restriction. Despite its name, the actual memory consumed by a resource queue may exceed a limit inferred from this value.</dd>

<dt>CORE\_LIMIT\_CLUSTER=\<percentage\> </dt>
<dd>Required. The percentage of consumable CPU (virtual core) resources that the resource queue can take from its parent resource queue. The valid values are 1% to 100%. The value of MEMORY\_ LIMIT\_CLUSTER must be identical to the value of CORE\_LIMIT\_CLUSTER. The sum of values for CORE\_LIMIT\_CLUSTER of this queue and queues that share the same parent cannot exceed 100%.</dd>
Expand Down