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

Add docs for property compression #962

Merged
merged 3 commits into from
Aug 13, 2024
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
2 changes: 2 additions & 0 deletions pages/database-management/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ in Memgraph.
| --storage-enable-edges-metadata=false | Utilizes additional memory to store metadata related to edges. This metadata is used to speed up id based lookups on edges. | `[bool]` |
| --storage-automatic-label-index-creation-enabled=false | Enables automatic creation of indices on labels. Only usable in IN_MEMORY_TRANSACTIONAL mode. | `[bool]` |
| --storage-automatic-edge-type-index-creation-enabled=false | Enables automatic creation of indices on edge types. Only usable in IN_MEMORY_TRANSACTIONAL mode. | `[bool]` |
| --storage-property-store-compression-enabled=false | Controls whether the properties should be compressed in the storage. | `[bool]` |
| --storage-property-store-compression-level=mid | Controls property store compression level. Allowed values: low, mid, high | `[string]` |

### Streams

Expand Down
17 changes: 17 additions & 0 deletions pages/fundamentals/storage-memory-usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,23 @@ Here are several tips how you can reduce memory usage and increase scalability:
4. [Inspect query plans](/querying/best-practices#profiling-queries)
and optimize them

#### Property compression

Another way to reduce memory usage is through property compression. This feature compresses the entire `PropertyStore` object, meaning it compresses all compressible properties in the database.
When property store compression is enabled, it checks if the `PropertyStore` of a vertex can be compressed, and if it can, it compresses it using the well-known compression library `zlib`.

To enable compression, set the `--storage-property-store-compression-enabled` flag to `true`. The default value of this flag is `false`.

Additionally, users can control the compression level with the `--storage-property-store-compression-level` flag. The default value is mid, but two other values, low and high, are also available.
The low setting compresses properties minimally, reducing memory usage slightly, while the high setting compresses properties the most, trying to maximize memory savings. However, there’s a tradeoff to consider:
higher compression levels can reduce performance. Therefore, users focused on maintaining optimal performance may prefer not to set it to `high`.

<Callout>

Keep in mind that even though it can reduce memory usage, compression can impact query performance.

</Callout>

### Deallocating memory

Memgraph has a garbage collector that deallocates unused objects, thus freeing
Expand Down