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

ent storage cache #1189

Merged
merged 13 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ When a transfer leadership command is committed, the leader will abandon its lea

To avoid split-brain, when members in a Raft Group change, an intermediate state is required. In such a state, the quorum of the old group and new group always have an overlap. Thus it prevents the old or new group from making decisions unilaterally. To make it even simpler, in his doctoral thesis Diego Ongaro suggests adding or removing a peer once to ensure the overlap between the quorum of the new group and the old group. Nebula Graph also uses this approach, except that the way to add or remove a member is different. For details, please refer to addPeer/removePeer in the Raft Part class.

## Cache

The cache management of RocksDB can not caching vertex or edge as required, Nebula Graph implemented storage cache management itself, users can set the storage cache size, content, etc. For more information, see [Storage cache configurations](../../5.configurations-and-logs/1.configurations/4.storage-config.md).

## Differences with HDFS

The Storage Service is a Raft-based distributed architecture, which has certain differences with that of HDFS. For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,25 @@ Supported options of `rocksdb_db_options` and `rocksdb_column_family_options` ar

For more information, see [RocksDB official documentation](https://rocksdb.org/).

## Storage cache configurations

!!! enterpriseonly

Only available for the Nebula Graph Enterprise Edition.

| Name | Predefined value | Description |
| :-----------------------------| :------| :------------------------------- |
| `enable_storage_cache` | `false`| Whether or not to enable storage cache. |
| `storage_cache_capacity` | `0` | Total capacity reserved for storage in memory cache. The value must be slightly greater than the sum of `vertex_pool_capacity` and `empty_key_pool_capacity`. The configuration is measured in MB.|
| `storage_cache_buckets_power` | `20` | The number of buckets. The value is a logarithm base 2, optional values are 0~32. For example, the value 20 indicates that the number of buckets is 2$^{20}$. The recommended value is `ceil(log2(cacheEntries * 1.6))`. `cacheEntries` indicates the total number of cache items.|
| `storage_cache_locks_power` | `10` | The number of locks. The value is a logarithm base 2, optional values are 0~32. For example, the value 10 indicates that the number of locks is 2$^{10}$. The recommended value is `max(1, storage_cache_buckets_power - 10)`. |
| `enable_vertex_pool` | `false`| Whether or not to add vertex pool in the cache. Only valid when storage cache is enabled. |
| `vertex_pool_capacity` | `50` | The size of vertex pool. The configuration is measured in MB.|
| `vertex_item_ttl` | `300` | The TTL of items of vertex pool. The configuration is measured in seconds. |
| `enable_empty_key_pool` | `false`| Whether or not to add empty_key pool in the cache. Only valid when storage cache is enabled. The empty_key indicates the queried key but does not exist. |
| `empty_key_pool_capacity` | `50` | The size of empty_key pool. The configuration is measured in MB. |
| `empty_key_item_ttl` | `300` | The TTL of items of empty_key pool. The configuration is measured in seconds. |

## For super-Large vertices

When the query starting from each vertex gets an edge, truncate it directly to avoid too many neighboring edges on the super-large vertex, because a single query occupies too much hard disk and memory. Or you can truncate a certain number of edges specified in the `Max_edge_returned_per_vertex` parameter. Excess edges will not be returned. This parameter applies to all spaces.
Expand Down