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

Apply global AQL query memory limit by default #13800

Merged
merged 8 commits into from
Mar 26, 2021

Conversation

jsteemann
Copy link
Contributor

Scope & Purpose

Apply global AQL query memory limit by default.

  • Introduce metrics for AQL query memory limit violations:

    • arangodb_aql_global_query_memory_limit_reached: Total number of times the
      global query memory limit was violated.
    • arangodb_aql_local_query_memory_limit_reached: Total number of times a
      local query memory limit was violated.
  • Set the default value for --query.global-memory-limit to around 90% of RAM,
    so that a global memory limit is now effective by default.

    The default global memory limit value is calculated by a formula depending on
    the amount of available RAM and will result in the following values for
    common RAM sizes:

    RAM: 0 (0MiB) Limit: 0 unlimited, %mem: n/a
    RAM: 134217728 (128MiB) Limit: 33554432 (32MiB), %mem: 25.0
    RAM: 268435456 (256MiB) Limit: 67108864 (64MiB), %mem: 25.0
    RAM: 536870912 (512MiB) Limit: 255013683 (243MiB), %mem: 47.5
    RAM: 805306368 (768MiB) Limit: 510027366 (486MiB), %mem: 63.3
    RAM: 1073741824 (1024MiB) Limit: 765041049 (729MiB), %mem: 71.2
    RAM: 2147483648 (2048MiB) Limit: 1785095782 (1702MiB), %mem: 83.1
    RAM: 4294967296 (4096MiB) Limit: 3825205248 (3648MiB), %mem: 89.0
    RAM: 8589934592 (8192MiB) Limit: 7752415969 (7393MiB), %mem: 90.2
    RAM: 17179869184 (16384MiB) Limit: 15504831938 (14786MiB), %mem: 90.2
    RAM: 25769803776 (24576MiB) Limit: 23257247908 (22179MiB), %mem: 90.2
    RAM: 34359738368 (32768MiB) Limit: 31009663877 (29573MiB), %mem: 90.2
    RAM: 42949672960 (40960MiB) Limit: 38762079846 (36966MiB), %mem: 90.2
    RAM: 68719476736 (65536MiB) Limit: 62019327755 (59146MiB), %mem: 90.2
    RAM: 103079215104 (98304MiB) Limit: 93028991631 (88719MiB), %mem: 90.2
    RAM: 137438953472 (131072MiB) Limit: 124038655509 (118292MiB), %mem: 90.2
    RAM: 274877906944 (262144MiB) Limit: 248077311017 (236584MiB), %mem: 90.2
    RAM: 549755813888 (524288MiB) Limit: 496154622034 (473169MiB), %mem: 90.2

  • 💩 Bugfix (requires CHANGELOG entry)
  • 🍕 New feature (requires CHANGELOG entry, feature documentation and release notes)
  • 🔥 Performance improvement
  • 🔨 Refactoring/simplification
  • 📖 CHANGELOG entry made

Backports:

  • Backports required for: 3.8

Related Information

  • Docs PR: To be done!!

Testing & Verification

  • The behavior in this PR was manually tested
  • This PR adds tests that were used to verify all changes:
    • Added new integration tests (server_parameters)

* Introduce metrics for AQL query memory limit violations:
  - `arangodb_aql_global_query_memory_limit_reached`: Total number of times the
    global query memory limit was violated.
  - `arangodb_aql_local_query_memory_limit_reached`: Total number of times a
    local query memory limit was violated.

* Set the default value for `--query.global-memory-limit` to around 90% of RAM,
  so that a global memory limit is now effective by default.

  The default global memory limit value is calculated by a formula depending on
  the amount of available RAM and will result in the following values for
  common RAM sizes:

  RAM:            0      (0MiB)  Limit:            0   unlimited, %mem:  n/a
  RAM:    134217728    (128MiB)  Limit:     33554432     (32MiB), %mem: 25.0
  RAM:    268435456    (256MiB)  Limit:     67108864     (64MiB), %mem: 25.0
  RAM:    536870912    (512MiB)  Limit:    255013683    (243MiB), %mem: 47.5
  RAM:    805306368    (768MiB)  Limit:    510027366    (486MiB), %mem: 63.3
  RAM:   1073741824   (1024MiB)  Limit:    765041049    (729MiB), %mem: 71.2
  RAM:   2147483648   (2048MiB)  Limit:   1785095782   (1702MiB), %mem: 83.1
  RAM:   4294967296   (4096MiB)  Limit:   3825205248   (3648MiB), %mem: 89.0
  RAM:   8589934592   (8192MiB)  Limit:   7752415969   (7393MiB), %mem: 90.2
  RAM:  17179869184  (16384MiB)  Limit:  15504831938  (14786MiB), %mem: 90.2
  RAM:  25769803776  (24576MiB)  Limit:  23257247908  (22179MiB), %mem: 90.2
  RAM:  34359738368  (32768MiB)  Limit:  31009663877  (29573MiB), %mem: 90.2
  RAM:  42949672960  (40960MiB)  Limit:  38762079846  (36966MiB), %mem: 90.2
  RAM:  68719476736  (65536MiB)  Limit:  62019327755  (59146MiB), %mem: 90.2
  RAM: 103079215104  (98304MiB)  Limit:  93028991631  (88719MiB), %mem: 90.2
  RAM: 137438953472 (131072MiB)  Limit: 124038655509 (118292MiB), %mem: 90.2
  RAM: 274877906944 (262144MiB)  Limit: 248077311017 (236584MiB), %mem: 90.2
  RAM: 549755813888 (524288MiB)  Limit: 496154622034 (473169MiB), %mem: 90.2
@jsteemann jsteemann added this to the devel milestone Mar 24, 2021
@jsteemann jsteemann requested a review from mpoeter March 25, 2021 10:10
@mpoeter
Copy link
Contributor

mpoeter commented Mar 25, 2021

We should also add unit tests for the violation tracking.

@jsteemann jsteemann merged commit 12c778f into devel Mar 26, 2021
@jsteemann jsteemann deleted the feature/apply-global-query-memory-limit branch March 26, 2021 11:49
elfringham pushed a commit to elfringham/arangodb that referenced this pull request Apr 20, 2021
* Apply global AQL query memory limit by default

* Introduce metrics for AQL query memory limit violations:
  - `arangodb_aql_global_query_memory_limit_reached`: Total number of times the
    global query memory limit was violated.
  - `arangodb_aql_local_query_memory_limit_reached`: Total number of times a
    local query memory limit was violated.

* Set the default value for `--query.global-memory-limit` to around 90% of RAM,
  so that a global memory limit is now effective by default.

  The default global memory limit value is calculated by a formula depending on
  the amount of available RAM and will result in the following values for
  common RAM sizes:

  RAM:            0      (0MiB)  Limit:            0   unlimited, %mem:  n/a
  RAM:    134217728    (128MiB)  Limit:     33554432     (32MiB), %mem: 25.0
  RAM:    268435456    (256MiB)  Limit:     67108864     (64MiB), %mem: 25.0
  RAM:    536870912    (512MiB)  Limit:    255013683    (243MiB), %mem: 47.5
  RAM:    805306368    (768MiB)  Limit:    510027366    (486MiB), %mem: 63.3
  RAM:   1073741824   (1024MiB)  Limit:    765041049    (729MiB), %mem: 71.2
  RAM:   2147483648   (2048MiB)  Limit:   1785095782   (1702MiB), %mem: 83.1
  RAM:   4294967296   (4096MiB)  Limit:   3825205248   (3648MiB), %mem: 89.0
  RAM:   8589934592   (8192MiB)  Limit:   7752415969   (7393MiB), %mem: 90.2
  RAM:  17179869184  (16384MiB)  Limit:  15504831938  (14786MiB), %mem: 90.2
  RAM:  25769803776  (24576MiB)  Limit:  23257247908  (22179MiB), %mem: 90.2
  RAM:  34359738368  (32768MiB)  Limit:  31009663877  (29573MiB), %mem: 90.2
  RAM:  42949672960  (40960MiB)  Limit:  38762079846  (36966MiB), %mem: 90.2
  RAM:  68719476736  (65536MiB)  Limit:  62019327755  (59146MiB), %mem: 90.2
  RAM: 103079215104  (98304MiB)  Limit:  93028991631  (88719MiB), %mem: 90.2
  RAM: 137438953472 (131072MiB)  Limit: 124038655509 (118292MiB), %mem: 90.2
  RAM: 274877906944 (262144MiB)  Limit: 248077311017 (236584MiB), %mem: 90.2
  RAM: 549755813888 (524288MiB)  Limit: 496154622034 (473169MiB), %mem: 90.2

* added "introducedIn" attribute

* added unit test for counters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants