超简单对nebula 压测实战

nebula 压测环境安装

准备工作

- nebula集群 5台
- 测试机一台
- 网络要互通

集群配置

CPU: 16core

Memory : 122G

Disk 900G * 2


压测机配置同上 1台

压测机极限可mock 65500 并发

测试k6的安装

wget https://github.com/vesoft-inc/k6-plugin/releases/download/v0.0.8/k6-linux-amd64

mv k6-linux-amd64 k6

chmod 755 k6

准备csv

https://github.com/vesoft-inc/k6-plugin/blob/master/example/person.csv

代码

import nebulaPool from 'k6/x/nebulagraph';
import { check } from 'k6';
import { Trend } from 'k6/metrics';
import { sleep } from 'k6';

var lantencyTrend = new Trend('latency');
var responseTrend = new Trend('responseTime');
// initial nebula connect pool
// by default the channel buffer size is 20000, you can reset it with
// var pool = nebulaPool.initWithSize("192.168.8.152:9669", {poolSize}, {bufferSize}); e.g.
// var pool = nebulaPool.initWithSize("192.168.8.152:9669", 1000, 4000)
var pool = nebulaPool.init("192.168.8.152:9669", 400);

// initial session for every vu
var session = pool.getSession("root", "nebula")
session.execute("USE sf1")


export function setup() {
  // config csv file
  pool.configCSV("person.csv", "|", false)
  // config output file, save every query information
  pool.configOutput("output.csv")
  sleep(1)
}

export default function (data) {
  // get csv data from csv file
  let d = session.getData()
  // d[0] means the first column data in the csv file
  let ngql = 'go 2 steps from ' + d[0] + ' over KNOWS '
  let response = session.execute(ngql)
  check(response, {
    "IsSucceed": (r) => r.isSucceed() === true
  });
  // add trend
lantencyTrend.add(response.getLatency());
responseTrend.add(response.getResponseTime());
};

export function teardown() {
  pool.close()
}

run

./k6 run nebula-test.js -u 65500 -d 1000s  

结果

结论

在保证 100%check的前提下,内存有足够的富裕,但是 cpu已经接近极限 80% 以上。

3 个赞

:joy: Bruce 你不展开讲讲机器、网络啥配置吗

因为这一块社区有很多文章介绍,我这个的目的就是 在这些介绍上面如何5分钟完备一个demo的 压测环境

1 个赞

:joy: 也对你也没有压测结果展示,不过我觉得你标题也许改成 5分钟完备一个demo的 压测环境更能阐述上面的小短文在做甚 。

那我 更新下 展示下我们生产集群的配置 还有压测结果

2 个赞

谢谢 Bruce