Used memory hits the high watermark(0.900000) of total system memory

充足的信息能提高解决问题的速度

  • nebula 版本:3.1.0(为节省回复者核对版本信息的时间,首次发帖的版本信息记得以截图形式展示)

  • 部署方式: 单机

  • 安装方式:DEB包

  • 是否为线上版本: N

  • 问题的具体描述


    时不时会出现Used memory hits the high watermark(0.900000) of total system memory,调整system_memory_high_watermark_ratio参数也无法根治,请问有什么根本解决的办法吗?

storage日志

W20221230 15:38:49.306982 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.22497e+09 vs. total: 1.6788e+10 in bytes.
E20221230 15:38:49.529971 2996920 QueryInstance.cpp:137] Used memory hits the high watermark(0.900000) of total system memory.
E20221230 15:38:50.072713 2996920 QueryInstance.cpp:137] Used memory hits the high watermark(0.900000) of total system memory.
W20221230 15:40:29.306810 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.21845e+09 vs. total: 1.6788e+10 in bytes.
E20221230 15:41:26.066296 2996915 QueryInstance.cpp:137] Used memory hits the high watermark(0.900000) of total system memory.
E20221230 15:41:39.633177 2996917 QueryInstance.cpp:137] Used memory hits the high watermark(0.900000) of total system memory.
W20221230 15:42:09.306797 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.21219e+09 vs. total: 1.6788e+10 in bytes.
W20221230 15:43:49.304561 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.21747e+09 vs. total: 1.6788e+10 in bytes.
W20221230 15:45:29.307475 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.21468e+09 vs. total: 1.6788e+10 in bytes.
W20221230 15:47:09.306509 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.20526e+09 vs. total: 1.6788e+10 in bytes.
W20221230 15:48:49.305521 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.20071e+09 vs. total: 1.6788e+10 in bytes.
W20221230 15:50:29.306141 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.1954e+09 vs. total: 1.6788e+10 in bytes.
W20221230 15:52:09.307078 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.17757e+09 vs. total: 1.6788e+10 in bytes.
W20221230 15:53:49.306814 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.18355e+09 vs. total: 1.6788e+10 in bytes.
W20221230 15:55:29.306334 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.17888e+09 vs. total: 1.6788e+10 in bytes.
W20221230 15:57:09.308118 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.17569e+09 vs. total: 1.6788e+10 in bytes.
W20221230 15:58:49.307900 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.16765e+09 vs. total: 1.6788e+10 in bytes.
W20221230 16:00:29.307514 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.15582e+09 vs. total: 1.6788e+10 in bytes.
E20221230 16:01:28.317843 2996917 QueryInstance.cpp:137] Used memory hits the high watermark(0.900000) of total system memory.
W20221230 16:02:09.306895 2997038 MemoryUtils.cpp:76] Memory usage has hit the high watermark of system, available: 1.1528e+09 vs. total: 1.6788e+10 in bytes.

storaged配置文件

########## basics ##########
# Whether to run as a daemon process
--daemonize=true
# The file to host the process id
--pid_file=pids/nebula-storaged.pid
# Whether to use the configuration obtained from the configuration file
--local_config=true

########## logging ##########
# The directory to host logging files
--log_dir=logs
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
--minloglevel=0
# Verbose log level, 1, 2, 3, 4, the higher of the level, the more verbose of the logging
--v=0
# Maximum seconds to buffer the log messages
--logbufsecs=0
# Whether to redirect stdout and stderr to separate output files
--redirect_stdout=true
# Destination filename of stdout and stderr, which will also reside in log_dir.
--stdout_log_file=storaged-stdout.log
--stderr_log_file=storaged-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
--stderrthreshold=2
# Wether logging files' name contain time stamp.
--timestamp_in_logfile_name=true

########## networking ##########
# Comma separated Meta server addresses
--meta_server_addrs=172.16.xx.xx:9559
# Local IP used to identify the nebula-storaged process.
# Change it to an address other than loopback if the service is distributed or
# will be accessed remotely.
--local_ip=172.16.xx.xx
# Storage daemon listening port
--port=9779
# HTTP service ip
--ws_ip=0.0.0.0
# HTTP service port
--ws_http_port=19779
# heartbeat with meta service
--heartbeat_interval_secs=10

######### Raft #########
# Raft election timeout
--raft_heartbeat_interval_secs=30
# RPC timeout for raft client (ms)
--raft_rpc_timeout_ms=500
## recycle Raft WAL
--wal_ttl=14400

########## Disk ##########
# Root data path. Split by comma. e.g. --data_path=/disk1/path1/,/disk2/path2/
# One path per Rocksdb instance.
--data_path=data/storage

# Minimum reserved bytes of each data path
--minimum_reserved_bytes=268435456

# The default reserved bytes for one batch operation
--rocksdb_batch_size=4096
# The default block cache size used in BlockBasedTable.
# The unit is MB.
--rocksdb_block_cache=4
# The type of storage engine, `rocksdb', `memory', etc.
--engine_type=rocksdb

# Compression algorithm, options: no,snappy,lz4,lz4hc,zlib,bzip2,zstd
# For the sake of binary compatibility, the default value is snappy.
# Recommend to use:
#   * lz4 to gain more CPU performance, with the same compression ratio with snappy
#   * zstd to occupy less disk space
#   * lz4hc for the read-heavy write-light scenario
--rocksdb_compression=lz4

# Set different compressions for different levels
# For example, if --rocksdb_compression is snappy,
# "no:no:lz4:lz4::zstd" is identical to "no:no:lz4:lz4:snappy:zstd:snappy"
# In order to disable compression for level 0/1, set it to "no:no"
--rocksdb_compression_per_level=

# Whether or not to enable rocksdb's statistics, disabled by default
--enable_rocksdb_statistics=false

# Statslevel used by rocksdb to collection statistics, optional values are
#   * kExceptHistogramOrTimers, disable timer stats, and skip histogram stats
#   * kExceptTimers, Skip timer stats
#   * kExceptDetailedTimers, Collect all stats except time inside mutex lock AND time spent on compression.
#   * kExceptTimeForMutex, Collect all stats except the counters requiring to get time inside the mutex lock.
#   * kAll, Collect all stats
--rocksdb_stats_level=kExceptHistogramOrTimers

# Whether or not to enable rocksdb's prefix bloom filter, enabled by default.
--enable_rocksdb_prefix_filtering=true
# Whether or not to enable rocksdb's whole key bloom filter, disabled by default.
--enable_rocksdb_whole_key_filtering=false

############## Key-Value separation ##############
# Whether or not to enable BlobDB (RocksDB key-value separation support)
--rocksdb_enable_kv_separation=false
# RocksDB key value separation threshold in bytes. Values at or above this threshold will be written to blob files during flush or compaction.
--rocksdb_kv_separation_threshold=100
# Compression algorithm for blobs, options: no,snappy,lz4,lz4hc,zlib,bzip2,zstd
--rocksdb_blob_compression=lz4
# Whether to garbage collect blobs during compaction
--rocksdb_enable_blob_garbage_collection=true

############## rocksdb Options ##############
# rocksdb DBOptions in json, each name and value of option is a string, given as "option_name":"option_value" separated by comma
--rocksdb_db_options={"max_open_files":"5000"}
# rocksdb ColumnFamilyOptions in json, each name and value of option is string, given as "option_name":"option_value" separated by comma
--rocksdb_column_family_options={"write_buffer_size":"67108864","max_write_buffer_number":"4","max_bytes_for_level_base":"268435456"}
# rocksdb BlockBasedTableOptions in json, each name and value of option is string, given as "option_name":"option_value" separated by comma
--rocksdb_block_based_table_options={"block_size":"40960"}
--cache_index_and_filter_blocks:false

麻烦补充下信息:

  1. 你的机器配置是啥?
  2. 发生水位报警的时候,查询语句是什么?以及涉及的大概数据量是多少;
  3. 顺便在查询语句前面加一个 explain 执行下,把查询计划也贴一下;
系统:Ubuntu 20.04.3 LTS
处理器:
架构:                           x86_64
CPU 运行模式:                   32-bit, 64-bit
字节序:                         Little Endian
Address sizes:                   43 bits physical, 48 bits virtual
CPU:                             8
在线 CPU 列表:                  0-7
每个核的线程数:                 1
每个座的核数:                   8
座:                             1
NUMA 节点:                      1
厂商 ID:                        GenuineIntel
CPU 系列:                       6
型号:                           85
型号名称:                       Intel(R) Xeon(R) Gold 5218R CPU @ 2.10GHz
步进:                           7
CPU MHz:                        2095.078
BogoMIPS:                       4190.15
超管理器厂商:                   VMware
虚拟化类型:                     完全
              总计         已用        空闲      共享    缓冲/缓存    可用
内存:       16010        1817         163         107       14028       13756

查询语句

USE `50690ce739a54652b6b638c0d7c08979`;LOOKUP ON `bfa674ec4dac483a99b81b0eb30bea9b` YIELD id(vertex)| YIELD COUNT(*) AS Sum ;

查询语句正常应该为

抱歉,第三个不知道怎么处理

USE 50690ce739a54652b6b638c0d7c08979; EXPLAIN LOOKUP ON bfa674ec4dac483a99b81b0eb30bea9b YIELD id(vertex)| YIELD COUNT(*) AS Sum ;

试试

是否语句有问题?

语句倒是没错,就是一个生成执行语句的命令。:thinking: 我决定喊个研发给你看看,稍等哈。

查询 TAG bfa674ec4dac483a99b81b0eb30bea9b 的总数,目前 count 并不能做到下推,这个查询涉及 bfa674ec4dac483a99b81b0eb30bea9b 上数据全部捞取。

请问 SHOW STATS 不能满足你的需求么?

才看到 storaged 上内存占用挺高的,不知道有多少 space,都多少 parts?

1 个赞

可以试试 conf里disable_page_cache设置成 true 以关闭操作系统的page cache;然后调大 rocksdb_block_cache 比如你内存的百分之五十,通过 rocksdb 的 block cache 来控制内存。

另外 cache_index_and_filter_blocks 可以设置为 true,让 index 和 bloom filter 也去用 block cache。

1 个赞

买个大内存条试试。。。
你语句不复杂,真的就是内存不够了

好的,谢谢

SHOW STATS会将所有的TAG和Edge type关联的点或边的总数给出,但是我只需要特定的某一个TAG或Edge type的

space十多个吧,parts是固定100个

好的,我尝试一下,可能需要时间验证

数据库是部署在公司的虚拟机,我先尝试其他的办法,如果实在不行只能再向公司申请拓展内存了 :joy:

单机不需要那么多 parts,它本身也是有固定内存占用的,建议都改成单个或者个位数 parts。

再就是 spw 给的配置建议和加内存

partition_num 我看文档中是说建议设置成硬盘数量的20倍,这个硬盘应该指的是存储用的机械硬盘或固态硬盘,那我的是部署在虚拟机内,是只需设置单个或个位数是吗?那之前已经创建好的space能否修改这个parts?

单机的话,不用分那么多了。
已经创建好的 space 不能修改,只能删掉重建给小的数

好的,谢谢,已改成10

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。