# Linuxerwang Test Benchmark Result

**URL:** <https://discuss.dgraph.io/t/linuxerwang-test-benchmark-result/12090>\
**Category:** Dev\
**Created:** [December 27, 2020, 6:39pm UTC](https://discuss.dgraph.io/t/linuxerwang-test-benchmark-result/12090 "2020-12-27T18:39:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aman-bansal](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/aman-bansal/32/4475_2.png) [@aman-bansal](https://discuss.dgraph.io/u/aman-bansal)\
**Post date:** [December 27, 2020, 6:39pm UTC](https://discuss.dgraph.io/t/linuxerwang-test-benchmark-result/12090/1 "2020-12-27T18:39:06Z")

</div>

Github Repository: [GitHub - linuxerwang/dgraph-bench: A benchmark program for dgraph.](https://github.com/linuxerwang/dgraph-bench)

* * *

Note: All test scenarios were run on a single machine. Cluster configuration like 1 alpha 1 zero or 3 alpha 1 zero was on one machine and benchmarks were running on another machine.

* * *

### Data Model

#### Schema

```auto
created_at: int .
name: string @index(term, fulltext) .
type: int .
updated_at: int .
xid: string @index(exact) .
friend_of: uid @count @reverse .

```

#### General Test setup

First Person nodes were inserted. And then `friend_of` edges were inserted to build the basic social structure.

## Results

### Insertion

#### 1 Zero 1 Alpha Node Insertion

Insert Person node operation was run for an hour. The average request rate was around 9k/sec with 0.2sec as 99 percentile. Around 9 million nodes were inserted during this period.

 ![Screenshot from 2020-12-28 00-02-07](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/7/79e91991ac75feee8d750afbe2622f35fd6dea28.png)

 ![Screenshot from 2020-12-28 00-02-13](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/0/09aab6e3c2a9474959991ef286569dbd0655cc72.png)

#### 1 Zero 3 Alpha Edge Insertion

Initially, approximately 13M People nodes were inserted. Then Insert friend queries were run for 24 hours in a loop via 100 goroutines. We were able to insert around 370M edges approximately.

 ![Screenshot from 2020-12-27 11-44-19](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/c/c68e416fb651697793508dd990ed78e844044271.png)

 ![Screenshot from 2020-12-27 11-47-50](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/8/862d6cce05da908ce88204c3118db760e5798976.png)

We were able to insert. The edge insertion rate started at 12k/sec but steadied around 4k/sec after a few hours. The same relative trend can be seen from the request duration percentile graph.

Performance improvement can be seen in [v1.0.x](https://github.com/linuxerwang/dgraph-bench/blob/master/1zero-3alpha-edge-insert-with-indexing-25hours.png) to v20.11. The sudden performance drops are no longer noticed during the simulation.

### Query Performance

For query performance, data was generated as per the linuxerwang recommendation. [GitHub - linuxerwang/dgraph-bench: A benchmark program for dgraph.](https://github.com/linuxerwang/dgraph-bench#query-performance)

#### Query One Hop

Tests ran for 5 hours with a pretty consistent request rate of around 13k/sec. The average request duration with 99 percetile is around 50ms and 30 ms 95 percentile.

 ![Screenshot from 2020-12-27 21-21-21](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/1/1e543b44cc2bf228273d79c29b1746dfc3331792.png)

 ![Screenshot from 2020-12-27 21-22-32](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/b/ba4188282099c88b9f5987b5017de9877b3325a4.png)

#### Query Two Hop

Tests ran for approximately 3 hours with a pretty consistent request rate of around 1.6k/sec. The average request duration with 99 percentile is around 800ms and 220 ms 95 percentile.

 ![Screenshot from 2020-12-27 21-27-32](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/8/8ad98ddbf4a909ff0391e2ca3d88105608492529.png)

 ![Screenshot from 2020-12-27 21-27-38](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/e/eaf8a33c0dc1db535de90b4e129c7eb53c6945b3.png)

* * *

Note: **For Previous Revision metrics were**

For one-hop friends query, it can easily handle 10k QPS on 100 concurrent request workers at ~300ms 99 percentile and 80ms 95 percentile. On two-hop friends query, dgraph provides ~1000 QPS on ~0.95s 95% percentile.

* * *

---

<div class="post-metadata">

**Author:** ![mrjn](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/mrjn/32/775_2.png) [@mrjn](https://discuss.dgraph.io/u/mrjn)\
**Post date:** [December 27, 2020, 8:12pm UTC](https://discuss.dgraph.io/t/linuxerwang-test-benchmark-result/12090/3 "2020-12-27T20:12:28Z")

</div>

Nice. Consistent by the looks of it. Did you notice any of the sudden jumps or drops etc.?

---

<div class="post-metadata">

**Author:** ![aman-bansal](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/aman-bansal/32/4475_2.png) [@aman-bansal](https://discuss.dgraph.io/u/aman-bansal)\
**Post date:** [December 28, 2020, 9:41am UTC](https://discuss.dgraph.io/t/linuxerwang-test-benchmark-result/12090/5 "2020-12-28T09:41:47Z")

</div>

No, i ran it for extended hours. The pattern of continuous performance jump and exponential degradation every few hours isn’t observed in 20.11 even after 24 hours. The only variable was all 3 alpha and 1 zero are on the same machine while original setup uses separate machines. This will add some network latency but not something that will disrupt the behaviour.
