Skip to content

Commit

Permalink
Add docs for property compression (#962)
Browse files Browse the repository at this point in the history
* add docs for property compression

* add suggestions
  • Loading branch information
DavIvek authored Aug 13, 2024
1 parent 95c788b commit 773387d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
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

0 comments on commit 773387d

Please sign in to comment.