CONFIG Syntax

Introduction to Configuration

Nebula Graph gets configuration from meta by default. If you want to get configuration locally, please add the --local_config=true option in the configuration files metad.conf, storaged.conf, graphd.conf (directory is /home/user/nebula/build/install/etc) respectively.

Note:

  • Configuration precedence: meta > console > environment variable > configuration files.
  • If set --local_config to true, the configuration files take precedence.
  • Restart the services after changing the configuration files to take effect.
  • Configuration changes in console take effect in real time.

gflag Parameters

Nebula Graph uses gflags for run-time configurations. gflags parameters see the following table.

Name Type Description
max_edge_returned_per_vertex MUTABLE Control the max edges returned by a certain vertex.
minloglevel MUTABLE Minimum log level.
v MUTABLE Debug log level.
heartbeat_interval_secs MUTABLE Heartbeat interval.
meta_client_retry_times MUTABLE Meta client retry times.
slow_op_threshhold_ms MUTABLE Default threshold for slow operation, set in ms
wal_ttl MUTABLE Default value is 14400 secondes
rocksdb_db_options NESTED Parameter in json format, and the key and value of them are in string format.
rocksdb_column_family_options NESTED Parameter in json format, and the key and value of them are in string format.
rocksdb_block_based_table_options NESTED Parameter in json format, and the key and value of them are in string format.

For example, you can set as follows in the conf file of storage:

    rocksdb_db_options = {"stats_dump_period_sec":"200", "enable_write_thread_adaptive_yield":"false", "write_thread_max_yield_usec":"600"}
    rocksdb_column_family_options = {"max_write_buffer_number":"4", "min_write_buffer_number_to_merge":"2", "max_write_buffer_number_to_maintain":"1"}
    rocksdb_block_based_table_options = {"block_restart_interval":"2"}
    "max_edge_returned_per_vertex":"INT_MAX"

Nebula Graph supports changing some rocksdb parameters in storage service as follows:

    // rocksdb_column_family_options
    disable_auto_compactions
    write_buffer_size
    max_write_buffer_number
    level0_file_num_compaction_trigger
    level0_slowdown_writes_trigger
    level0_stop_writes_trigger
    target_file_size_base
    target_file_size_multiplier
    max_bytes_for_level_base
    max_bytes_for_level_multiplier

    // rocksdb_db_options
    max_total_wal_size
    delete_obsolete_files_period_micros
    max_background_jobs
    stats_dump_period_sec
    compaction_readahead_size
    writable_file_max_buffer_size
    bytes_per_sync
    wal_bytes_per_sync
    delayed_write_rate
    avoid_flush_during_shutdown
    max_open_files

For example

nebula> UPDATE CONFIGS storage:rocksdb_column_family_options = \
        { disable_auto_compactions = false ,         level0_file_num_compaction_trigger = 10 }

Reservoir Sampling Parameters

Set the following parameters in the configuration file storaged-conf:

enable_reservoir_sampling = true/false # Enable reservoir sampling with true.
max_edge_returned_per_vertex = number # Set the sampling number.

For super vertex with a large number of edges, currently there are two truncation strategies:

  1. Truncate directly. Set the enable_reservoir_sampling parameter to false. A certain number of edges specified in the Max_edge_returned_per_vertex parameter are truncated by default.

  2. Truncate with the reservoir sampling algorithm. Based on the algorithm, a certain number of edges specified in the Max_edge_returned_per_vertex parameter are truncated with equal probability from the total n edges. Equal probability sampling is useful in some business scenarios. However, the performance is effected compared to direct truncation due to the probability calculation.

SHOW CONFIGS

SHOW CONFIGS [graph|meta|storage]

For example

nebula> SHOW CONFIGS meta
============================================================================================================================
| module | name                                        | type   | mode      | value                                        |
============================================================================================================================
| META   | v                                           | INT64  | IMMUTABLE | 4                                            |
----------------------------------------------------------------------------------------------------------------------------
| META   | help                                        | BOOL   | IMMUTABLE | False                                        |
----------------------------------------------------------------------------------------------------------------------------
| META   | port                                        | INT64  | IMMUTABLE | 45500                                        |
----------------------------------------------------------------------------------------------------------------------------

Get CONFIGS

GET CONFIGS [graph|meta|storage :] var

For example

nebula> GET CONFIGS storage:local_ip
=======================================================
| module  | name     | type   | mode      | value     |
=======================================================
| STORAGE | local_ip | STRING | IMMUTABLE | 127.0.0.1 |
-------------------------------------------------------
nebula> GET CONFIGS heartbeat_interval_secs
=================================================================
| module  | name                    | type  | mode      | value |
=================================================================
| GRAPH   | heartbeat_interval_secs | INT64 | MUTABLE | 10    |
-----------------------------------------------------------------
| STORAGE | heartbeat_interval_secs | INT64 | MUTABLE | 10    |
-----------------------------------------------------------------

Update CONFIGS

UPDATE CONFIGS [graph|meta|storage :] var = value

The updated CONFIGS will be stored into meta-service permanently. If the configuration's mode is MUTABLE, the change will take effects immediately. Otherwise, if the mode is REBOOT, the change will not work until server restart. Expression is supported in UPDATE CONFIGS. For example

nebula> UPDATE CONFIGS storage:heartbeat_interval_secs=1
nebula> GET CONFIGS storage:heartbeat_interval_secs
===============================================================
| module  | name                    | type  | mode    | value |
===============================================================
| STORAGE | heartbeat_interval_secs | INT64 | MUTABLE | 1     |
---------------------------------------------------------------