diff --git a/pages/database-management/enabling-memgraph-enterprise.mdx b/pages/database-management/enabling-memgraph-enterprise.mdx index 3aecb48f0..de6e9bf06 100644 --- a/pages/database-management/enabling-memgraph-enterprise.mdx +++ b/pages/database-management/enabling-memgraph-enterprise.mdx @@ -93,10 +93,14 @@ SHOW LICENSE INFO; ## Upgrading or downgrading the license Memgraph licenses are issued based on the maximum unique data stored. So, if you -get a 1TB license, you can store 1TB of data. When you reach that capacity you -will no longer be able to run `write` queries, only `read` and `delete` queries. -That means it is possible to analyze the existing data but new data can no -longer be added until you upgrade or free storage by deleting some of the data. +get a 1TB license, you can store 1TB of data. The enforced value is +`memory_tracked` (visible in [`SHOW STORAGE INFO`](/database-management/server-stats#storage-information)), +which represents the total RAM allocated and tracked by Memgraph across all +databases in the instance. When `memory_tracked` reaches the license's +`memory_limit`, write queries are blocked — only `read` and `delete` queries +are allowed. That means it is possible to analyze the existing data but new data +can no longer be added until you upgrade or free storage by deleting some of the +data. Upon upgrading the license by entering a new license key the `write` queries will be enabled. When multiple valid license keys are present (for example a CLI @@ -104,7 +108,8 @@ key and a key set via `SET DATABASE SETTING`), Memgraph automatically picks the one with the furthest expiry, so providing a longer-lived key from any source takes effect immediately. -To check the used storage, run `SHOW STORAGE INFO;`. +To check the used storage, run `SHOW STORAGE INFO;` and compare the +`memory_tracked` value against the `allocation_limit`. ## License key expiry diff --git a/pages/database-management/monitoring.mdx b/pages/database-management/monitoring.mdx index d5d540d4b..57a1951b6 100644 --- a/pages/database-management/monitoring.mdx +++ b/pages/database-management/monitoring.mdx @@ -258,8 +258,8 @@ three different types: | average_degree | Counter | Average number of relationships of a single node. | | disk_usage | Gauge | Amount of disk space used by the [data directory](/fundamentals/data-durability) (in bytes). | | edge_count | Counter | Number of relationships stored in the system. | - | memory_usage | Gauge | Amount of RAM used reported by the OS (in bytes). | - | peak_memory_usage | Gauge | Peak amount of RAM used reported by the OS (in bytes). | + | memory_usage | Gauge | Amount of RAM used reported by the OS (in bytes). This corresponds to `memory_res` in `SHOW STORAGE INFO` and reflects the OS-reported resident set size — **not** the value used for [license enforcement](/database-management/enabling-memgraph-enterprise#upgrading-or-downgrading-the-license). To monitor the license-enforced value, check `memory_tracked` via [`SHOW STORAGE INFO`](/database-management/server-stats#storage-information). | + | peak_memory_usage | Gauge | Peak amount of RAM used reported by the OS (in bytes). Corresponds to `peak_memory_res` in `SHOW STORAGE INFO`. | | unreleased_delta_objects | Counter | Number of unreleased delta objects. | | vertex_count | Counter | Number of nodes stored in the system. | | SocketConnect_us_50p | Histogram | Latency of connecting to the socket, 50th percentile. | diff --git a/pages/database-management/server-stats.md b/pages/database-management/server-stats.md index cdb4e4bf3..91255963e 100644 --- a/pages/database-management/server-stats.md +++ b/pages/database-management/server-stats.md @@ -27,22 +27,24 @@ SHOW STORAGE INFO; The result will contain the following fields: +> **Instance-wide vs. per-database fields:** The memory-related fields (`memory_res`, `peak_memory_res`, `memory_tracked`, `allocation_limit`) are **instance-wide** — they reflect the total memory used by the entire Memgraph process across all databases. The `disk_usage` field, `vertex_count`, `edge_count` and `average_degree` are **per-database**, scoped to the database you are currently connected to. + | Field | Description | |------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | name | Name of the current database. | | database_uuid | Unique UUID of the database. | -| vertex_count | The number of stored nodes (vertices). | -| edge_count | The number of stored relationships (edges). | -| average_degree | The average number of relationships of a single node. | +| vertex_count | The number of stored nodes (vertices) in the current database. | +| edge_count | The number of stored relationships (edges) in the current database. | +| average_degree | The average number of relationships of a single node in the current database. | | vm_max_map_count | The number of memory-mapped areas that the kernel allows a process to have. If it is unknown, returns -1.
For more info, check out [virtual memory section of the docs](/fundamentals/storage-memory-usage#virtual-memory). | -| memory_res | The non-swapped physical RAM memory a task has used, reported by the OS (in B, KiB, MiB, GiB or TiB). | -| peak_memory_res | Peak RAM memory usage in the system during the whole run. | +| memory_res | The non-swapped physical RAM memory used by the whole Memgraph process, as reported by the OS (in B, KiB, MiB, GiB or TiB). This is instance-wide and includes all databases. | +| peak_memory_res | Peak RAM memory usage of the Memgraph process during the whole run (instance-wide). | | unreleased_delta_objects | The current number of still allocated objects with the information about the changes that write transactions have made, called Delta objects. Refer to allocation and deallocation of Delta objects [on this page](/fundamentals/storage-memory-usage#in-memory-transactional-storage-mode-default). | -| disk_usage | The amount of disk space used by the data directory (in B, KiB, MiB, GiB or TiB). | -| memory_tracked | The amount of RAM allocated in the system and tracked by Memgraph (in B, KiB, MiB, GiB or TiB).
For more info, check out [memory control](/fundamentals/storage-memory-usage). | +| disk_usage | The amount of disk space used by the current database's data directory (in B, KiB, MiB, GiB or TiB). | +| memory_tracked | The amount of RAM allocated in the system and tracked by Memgraph across all databases (in B, KiB, MiB, GiB or TiB). **This is the value used for [license enforcement](/database-management/enabling-memgraph-enterprise#upgrading-or-downgrading-the-license)** — when it reaches the `allocation_limit`, write queries are blocked.
For more info, check out [memory control](/fundamentals/storage-memory-usage). | | graph_memory_tracked | The portion of `memory_tracked` used by graph structures (vertices, edges, properties). | | vector_index_memory_tracked | The portion of `memory_tracked` used by vector index embeddings. | -| allocation_limit | The current allocation limit set for this instance (in B, KiB, MiB, GiB or TiB).
For more info, check out the [memory control](/fundamentals/storage-memory-usage#control-memory-usage). | +| allocation_limit | The current allocation limit for the whole instance (in B, KiB, MiB, GiB or TiB). This is set to the lower of the [Enterprise license memory limit](/database-management/enabling-memgraph-enterprise) and the [`--memory-limit` configuration flag](/fundamentals/storage-memory-usage#control-memory-usage). | | global_isolation_level | The current `global` isolation level.
For more info, check out [isolation levels](/fundamentals/transactions#isolation-levels). | | session_isolation_level | The current `session` isolation level. | | next_session_isolation_level | The current `next` isolation level. | @@ -65,7 +67,7 @@ SHOW LICENSE INFO; | is_valid | Whether the license is currently valid. Uses the same validation logic as enterprise feature checks. | | license_type | Enterprise / OEM | | valid_until | Date when the license expires, or `FOREVER` for non-expiring licenses. | -| memory_limit | Memory limit (in GiB). | +| memory_limit | The maximum `memory_tracked` value allowed by this license (in GiB). When `memory_tracked` (from `SHOW STORAGE INFO`) reaches this limit, write queries are blocked. | | status | Descriptive status of the license validity. | If no license has been provided, `is_valid` is `false` and `status` reads diff --git a/pages/fundamentals/storage-memory-usage.mdx b/pages/fundamentals/storage-memory-usage.mdx index a46a18d05..d621dd413 100644 --- a/pages/fundamentals/storage-memory-usage.mdx +++ b/pages/fundamentals/storage-memory-usage.mdx @@ -683,6 +683,8 @@ memory limit is exceeded, only the queries that don't require additional memory are allowed. If the memory limit is exceeded while a query is running, the query is aborted and its transaction becomes invalid. +The effective allocation limit (shown as `allocation_limit` in `SHOW STORAGE INFO`) is set to the **lower** of the `--memory-limit` configuration flag and the [Enterprise license memory limit](/database-management/enabling-memgraph-enterprise#upgrading-or-downgrading-the-license). This limit applies to the entire Memgraph instance across all databases — there is currently no per-database memory quota. + If the flag is set to 0, it will use the default values. Default values are: - 90% of the total memory if the system doesn't have swap memory.