Janusgraph压测

Date: 2019/05/16 Categories: 工作 Tags: wrk janusgraph benchmark


因为之前出现了janusgraph服务不可用的情况, 我们决定压测一下服务.

在第一次压测中, 因为使用了ZGC且开启了jg的database cache, 出现了heap out of memory的问题, 我们调整了gc(设置了new ratio和启用更成熟的g1gc), 禁用了cache进行了 第二次压测, 没有发生问题

生成post body数据的代码如下, 简单来说使用实体名, 来生成subgraph查询

#!/usr/bin/env python

import sys
import ujson

for line in sys.stdin:
    name = line.strip().decode('utf8')
    name.replace('"', "/")
    gremlin = "g.V().has(/name/, name).order().by(/popular/, decr).limit(1).properties()"
    stat = u'{"gremlin":"%s", "bindings":{"name":"%s"}}"' % (gremlin, name,)
    print stat.encode('utf8')

这里使用了前100000行的数据从tql.txt中作为post body, 注意wrk的每个线程都会加载一份数据. 运行 wrk --latency -c 16 -t 8 -d 86400s -s 1.lua http://127.0.0.1:8182

Running 1440m test @ http://127.0.0.1:8182
  8 threads and 16 connections
n  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    25.48ms   51.70ms   1.97s    97.20%
    Req/Sec   109.65     45.33   740.00     68.81%
  Latency Distribution
     50%   18.95ms
     75%   39.68ms
     90%   52.60ms
     99%  119.05ms
  75182324 requests in 1440.01m, 237.05GB read
  Socket errors: connect 0, read 16373, write 3118830, timeout 803
  Non-2xx or 3xx responses: 16338
Requests/sec:    870.16
Transfer/sec:      2.81MB

可以看到qps为870, 平均延迟是25.48ms, 50 percentile为18.95ms