Star

nebula2.0 go速度太慢?

为了更快地定位、解决问题,麻烦参考下面模版提问 ^ ^

提问参考模版:

  • nebula 版本:2.0-beta

  • 部署方式(分布式 / 单机 / Docker / DBaaS):单机

  • 硬件信息

    • 磁盘( 必须为 SSD ,不支持 HDD)256 ssd
    • CPU、内存信息:128G
  • 数据集

点边文件不到2G
  • 问题的具体描述
    2.0版本的go语句有改动吗, 相同的代码,相同的数据在1.2上跑几秒,2.0跑一个小时没跑出来

唯一改的就是点id加了引号?

GO 1 TO 2 STEPS FROM "3301167" OVER ed WHERE ed._dst != "3301167" YIELD ed._dst AS vid | GROUP BY $-.vid YIELD 1 AS id | GROUP BY $-.id YIELD COUNT($-.id);

lsz@128g-16:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:         128612        4667       77462          42       46482      123341
Swap:        130741           0      130741

这跟预期不符啊 :joy:, 能再提供点线索我们本地试着复现下吗?

  • 图数据库
# https://github.com/vesoft-inc/nebula-graph/releases/tag/v2.0.0-beta
nebula-graph-2.0.0-beta.ubuntu1604.amd64.deb
  • 配置文件未做修改
  • 建图语句
create space user_relate;
use user_relate;
CREATE TAG ve(id int);
CREATE EDGE ed();
  • 点边示例
// 点数量500w
// 边数量 1.5亿

点
1
2
3
...
range(1,500w)

// 1-->2  1关注2
边
1,2
1,3
2,3
...
rand(1,500w),rand(1,500w)

  • 导图工具
sudo docker run --rm -ti -v /home/lsz/graph_data/user_relate/:/home/lsz/graph_data/user_relate/  vesoft/nebula-importer:v2 --config /home/lsz/graph_data/user_relate/user_relate.yaml

你的环境里单纯go 2 steps差异很大么,先插个眼

跑最短路径的时候,把图跑挂了

OOM 了?

测试语句

FIND SHORTEST PATH FROM "1798925" to "2702926" OVER * UPTO 5 STEPS;

//错误信息:
[ERROR (-8)]: Storage Error: part: 77, error code: -3.

下面为错误导致结束的三个时间节点下的内存变化: 刚结束,结束一分钟,结束一段时间

图挂了是说, graphd 挂了?

挂的次数最多的是graphd,三个服务不会全部停掉

错误信息
2020/12/21 14:47:15 [ERROR] Error info: write tcp 127.0.0.1:22200->127.0.0.1:3699: write: broken pipe

这个挂的比例倒是符合预期,
graphd 最容易 OOM(多跳的每一跳数据它都要 keep 住),
storaged 相对来说不会有那么高的内存占用, 一般来讲只会hold 住一跳的 data,
metad 正常情况下就维护个 metadata, 没啥负载

2.0 beta 还在调优的过程中, 慢的问题我们会分析下.

1赞

好的,谢谢. :grinning:
有个疑问: 个别服务异常终止的时候, 无法使用命令来关闭其他正在运行的服务,只能通过sudo kill -9 xxx

graphd异常终止,我无法使用 sudo /usr/local/nebula/scripts/nebula.service stop all 来关闭剩下的服务

可能是启动脚本错误检查的问题,这个好查的

你好,麻烦有机会的话 可以试一下在 在这条命令前面加 profile 试一下,看一下每个算子 所耗费的时间

+--------------+
| COUNT($-.id) |
+--------------+
| 794347       |
+--------------+
Got 1 rows (time spent 1510095801/5805052847 us)

Execution Plan

-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
| id | name         | dependencies | profiling data                                                        | operator info                                                                      |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
|  9 | Aggregate    | 8            | ver: 0, rows: 1, execTime: 78705us, totalTime: 78707us                | outputVar: [{"colNames":["COUNT($-.id)"],"name":"__Aggregate_9","type":"DATASET"}] |
|    |              |              |                                                                       | inputVar: __Aggregate_8                                                            |
|    |              |              |                                                                       | groupKeys: ["$-.id"]                                                               |
|    |              |              |                                                                       | groupItems: [{"expr":"$-.id","distinct":"false","funcType":1}]                     |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
|  8 | Aggregate    | 7            | ver: 0, rows: 794347, execTime: 3113652us, totalTime: 3113657us       | outputVar: [{"colNames":["id"],"name":"__Aggregate_8","type":"DATASET"}]           |
|    |              |              |                                                                       | inputVar: __DataCollect_7                                                          |
|    |              |              |                                                                       | groupKeys: ["$-.vid"]                                                              |
|    |              |              |                                                                       | groupItems: [{"expr":"1","distinct":"false","funcType":0}]                         |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
|  7 | DataCollect  | 6            | ver: 0, rows: 3624132, execTime: 63125us, totalTime: 63130us          | outputVar: [{"colNames":["vid"],"name":"__DataCollect_7","type":"DATASET"}]        |
|    |              |              |                                                                       | inputVar: [{"colNames":["vid"],"name":"__Project_5","type":"DATASET"}]             |
|    |              |              |                                                                       | kind: M TO N                                                                       |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
|  6 | Loop         | 11           | ver: 0, rows: 1, execTime: 9us, totalTime: 10us                       | outputVar: [{"colNames":[],"name":"__Loop_6","type":"DATASET"}]                    |
|    |              |              | ver: 1, rows: 1, execTime: 6us, totalTime: 7us                        | inputVar:                                                                          |
|    |              |              | ver: 2, rows: 1, execTime: 9us, totalTime: 10us                       | condition: (++($__VAR_1{0})<=2)                                                    |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
|  5 | Project      | 4            | ver: 0, rows: 2691, execTime: 1439us, totalTime: 1441us               | branch: true, nodeId: 6                                                            |
|    |              |              | ver: 1, rows: 3621441, execTime: 628263us, totalTime: 628266us        |                                                                                    |
|    |              |              |                                                                       | outputVar: [{"colNames":["vid"],"name":"__Project_5","type":"DATASET"}]            |
|    |              |              |                                                                       | inputVar: __Filter_4                                                               |
|    |              |              |                                                                       | columns: ed._dst AS vid                                                            |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
|  4 | Filter       | 3            | ver: 0, rows: 2691, execTime: 1112us, totalTime: 1113us               | outputVar: [{"colNames":["_vid"],"name":"__Filter_4","type":"DATASET"}]            |
|    |              |              | ver: 1, rows: 3621441, execTime: 463086us, totalTime: 463088us        | inputVar: __GetNeighbors_1                                                         |
|    |              |              |                                                                       | condition: (ed._dst!=3301167)                                                      |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
|  3 | Dedup        | 2            | ver: 0, rows: 2691, execTime: 1456us, totalTime: 1458us               | outputVar: [{"colNames":["_vid"],"name":"__VAR_0","type":"DATASET"}]               |
|    |              |              | ver: 1, rows: 794070, execTime: 5793673321us, totalTime: 5793673326us | inputVar: __Project_2                                                              |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
|  2 | Project      | 1            | ver: 0, rows: 2691, execTime: 1360us, totalTime: 1362us               | outputVar: [{"colNames":["_vid"],"name":"__Project_2","type":"DATASET"}]           |
|    |              |              | ver: 1, rows: 3621441, execTime: 558786us, totalTime: 558790us        | inputVar: __GetNeighbors_1                                                         |
|    |              |              |                                                                       | columns: *._dst AS _vid                                                            |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
|  1 | GetNeighbors | 0            | ver: 0, rows: 2691, execTime: 772us, totalTime: 315501us              | outputVar: [{"colNames":[],"name":"__GetNeighbors_1","type":"DATASET"}]            |
|    |              |              | ver: 1, rows: 3621441, execTime: 231401us, totalTime: 6162265us       | inputVar: __VAR_0                                                                  |
|    |              |              |                                                                       | space: 1                                                                           |
|    |              |              |                                                                       | dedup: false                                                                       |
|    |              |              |                                                                       | limit: 9223372036854775807                                                         |
|    |              |              |                                                                       | filter:                                                                            |
|    |              |              |                                                                       | orderBy: []                                                                        |
|    |              |              |                                                                       | src: $__VAR_0._vid                                                                 |
|    |              |              |                                                                       | edgeTypes: []                                                                      |
|    |              |              |                                                                       | edgeDirection: OUT_EDGE                                                            |
|    |              |              |                                                                       | vertexProps:                                                                       |
|    |              |              |                                                                       | edgeProps: [{"props":["_dst"],"type":"3"}]                                         |
|    |              |              |                                                                       | statProps:                                                                         |
|    |              |              |                                                                       | exprs:                                                                             |
|    |              |              |                                                                       | random: false                                                                      |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
|  0 | Start        |              | ver: 0, rows: 0, execTime: 0us, totalTime: 19us                       | outputVar: [{"colNames":[],"name":"__Start_0","type":"DATASET"}]                   |
|    |              |              | ver: 1, rows: 0, execTime: 1us, totalTime: 63us                       |                                                                                    |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------
| 11 | Start        |              | ver: 0, rows: 0, execTime: 1us, totalTime: 75us                       | outputVar: [{"colNames":[],"name":"__Start_11","type":"DATASET"}]                  |
-----+--------------+--------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------

Wed, 23 Dec 2020 10:16:59 CST

你好,帮忙把 etc 目录下 nebula-graph.conf 和 nebula-storage.conf文件 贴一下, 看看配置属性

配置文件未做修改

  • nebula-graph.conf
########## basics ##########
# Whether to run as a daemon process
--daemonize=true
# The file to host the process id
--pid_file=pids/nebula-graphd.pid
# Whether to enable optimizer
--enable_optimizer=false

########## logging ##########
# The directory to host logging files, which must already exists
--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=stdout.log
--stderr_log_file=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

########## networking ##########
# Meta Server Address
--meta_server_addrs=127.0.0.1:45500
# Local ip
--local_ip=127.0.0.1
# Network device to listen on
--listen_netdev=any
# Port to listen on
--port=3699
# To turn on SO_REUSEPORT or not
--reuse_port=false
# Backlog of the listen socket, adjust this together with net.core.somaxconn
--listen_backlog=1024
# Seconds before the idle connections are closed, 0 for never closed
--client_idle_timeout_secs=0
# Seconds before the idle sessions are expired, 0 for no expiration
--session_idle_timeout_secs=0
# The number of threads to accept incoming connections
--num_accept_threads=1
# The number of networking IO threads, 0 for # of CPU cores
--num_netio_threads=0
# The number of threads to execute user queries, 0 for # of CPU cores
--num_worker_threads=0
# HTTP service ip
--ws_ip=127.0.0.1
# HTTP service port
--ws_http_port=13000
# HTTP2 service port
--ws_h2_port=13002

# The default charset when a space is created
--default_charset=utf8
# The defaule collate when a space is created
--default_collate=utf8_bin

########## authorization ##########
# Enable authorization
--enable_authorize=false

########## Authentication ##########
# User login authentication type, password for nebula authentication, ldap for ldap authentication, cloud for cloud authentication
--auth_type=password

  • nebula-storage.conf
########## basics ##########
# Whether to run as a daemon process
--daemonize=true
# The file to host the process id
--pid_file=pids/nebula-storaged.pid

########## logging ##########
# The directory to host logging files, which must already exists
--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

########## networking ##########
# Meta server address
--meta_server_addrs=127.0.0.1:45500
# Local ip
--local_ip=127.0.0.1
# Storage daemon listening port
--port=44500
# HTTP service ip
--ws_ip=127.0.0.1
# HTTP service port
--ws_http_port=12000
# HTTP2 service port
--ws_h2_port=12002

######### 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
# Wal path for listener. Conflicts with data_path, if listener_path is specified, the storaged will
# start as listener (only wal is saved, no storage engine).
# --listener_path=data/listener

# 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=snappy

# 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, disabled by default.
--enable_rocksdb_prefix_filtering=false
# Whether or not to enable the whole key filtering.
--enable_rocksdb_whole_key_filtering=true
# The prefix length for each key to use as the filter value.
# can be 12 bytes(PartitionId + VertexID), or 16 bytes(PartitionId + VertexID + TagID/EdgeType).
--rocksdb_filtering_prefix_length=12

############## rocksdb Options ##############
--rocksdb_disable_wal=true
# 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={}
# 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":"8192"}

多谢您的回复,我们会内部做性能测试,如果有修改,会及时通知您

浙ICP备20010487号