Skip to content

Instantly share code, notes, and snippets.

@kmvinoth
Forked from maxdemarzi/__usage.adoc
Created November 20, 2019 15:16
Show Gist options
  • Select an option

  • Save kmvinoth/e8c44d53ea3d645d75008fae03b4ffae to your computer and use it in GitHub Desktop.

Select an option

Save kmvinoth/e8c44d53ea3d645d75008fae03b4ffae to your computer and use it in GitHub Desktop.

Revisions

  1. @jexp jexp revised this gist Aug 30, 2015. 3 changed files with 129 additions and 1 deletion.
    126 changes: 126 additions & 0 deletions __usage.adoc
    Original file line number Diff line number Diff line change
    @@ -114,4 +114,130 @@ Percentage of the requests served within a certain time (ms)
    98% 11
    99% 12
    100% 208 (longest request)
    ----

    === Lookup by property

    ----
    ./_run_ab.sh 24 100000 simple_lookup_property.json 12474
    This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    Benchmarking 127.0.0.1 (be patient)
    Completed 10000 requests
    Completed 20000 requests
    Completed 30000 requests
    Completed 40000 requests
    Completed 50000 requests
    Completed 60000 requests
    Completed 70000 requests
    Completed 80000 requests
    Completed 90000 requests
    Completed 100000 requests
    Finished 100000 requests
    Server Software: Jetty(9.2.4.v20141103)
    Server Hostname: 127.0.0.1
    Server Port: 12474
    Document Path: /db/data/transaction/commit
    Document Length: 114 bytes
    Concurrency Level: 24
    Time taken for tests: 3.364 seconds
    Complete requests: 100000
    Failed requests: 0
    Keep-Alive requests: 100000
    Total transferred: 31100000 bytes
    Total body sent: 31800000
    HTML transferred: 11400000 bytes
    Requests per second: 29730.25 [#/sec] (mean)
    Time per request: 0.807 [ms] (mean)
    Time per request: 0.034 [ms] (mean, across all concurrent requests)
    Transfer rate: 9029.40 [Kbytes/sec] received
    9232.64 kb/s sent
    18262.04 kb/s total
    Connection Times (ms)
    min mean[+/-sd] median max
    Connect: 0 0 0.0 0 1
    Processing: 0 1 3.6 1 199
    Waiting: 0 1 3.6 1 199
    Total: 0 1 3.6 1 199
    Percentage of the requests served within a certain time (ms)
    50% 1
    66% 1
    75% 1
    80% 1
    90% 1
    95% 2
    98% 4
    99% 5
    100% 199 (longest request)
    ----

    === Lookup by id

    ----
    ./_run_ab.sh 24 100000 simple_lookup.json 12474
    This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    Benchmarking 127.0.0.1 (be patient)
    Completed 10000 requests
    Completed 20000 requests
    Completed 30000 requests
    Completed 40000 requests
    Completed 50000 requests
    Completed 60000 requests
    Completed 70000 requests
    Completed 80000 requests
    Completed 90000 requests
    Completed 100000 requests
    Finished 100000 requests
    Server Software: Jetty(9.2.4.v20141103)
    Server Hostname: 127.0.0.1
    Server Port: 12474
    Document Path: /db/data/transaction/commit
    Document Length: 69 bytes
    Concurrency Level: 24
    Time taken for tests: 1.911 seconds
    Complete requests: 100000
    Failed requests: 0
    Keep-Alive requests: 100000
    Total transferred: 26500000 bytes
    Total body sent: 31100000
    HTML transferred: 6900000 bytes
    Requests per second: 52318.60 [#/sec] (mean)
    Time per request: 0.459 [ms] (mean)
    Time per request: 0.019 [ms] (mean, across all concurrent requests)
    Transfer rate: 13539.48 [Kbytes/sec] received
    15889.73 kb/s sent
    29429.21 kb/s total
    Connection Times (ms)
    min mean[+/-sd] median max
    Connect: 0 0 0.0 0 1
    Processing: 0 0 1.7 0 95
    Waiting: 0 0 1.7 0 95
    Total: 0 0 1.7 0 95
    Percentage of the requests served within a certain time (ms)
    50% 0
    66% 0
    75% 1
    80% 1
    90% 1
    95% 1
    98% 1
    99% 1
    100% 95 (longest request)
    ----
    3 changes: 2 additions & 1 deletion _run_ab.sh
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,5 @@
    CONCURRENT=${1-10}
    REQUESTS=${2-10000}
    COMMAND=${3-postquery.json}
    ab -k -c $CONCURRENT -n $REQUESTS -p $COMMAND -T application/json -H accept:application/json http://127.0.0.1:9474/db/data/transaction/commit
    PORT=${4-7474}
    ab $AB_OPTS -k -c $CONCURRENT -n $REQUESTS -p $COMMAND -T application/json -H accept:application/json http://127.0.0.1:${PORT}/db/data/transaction/commit
    1 change: 1 addition & 0 deletions simple_lookup_property.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"statements":[{"statement":"MATCH (n:Tag) WHERE n.tagId = 'neo4j' return n"}]}
  2. @jexp jexp revised this gist Jun 13, 2015. 1 changed file with 117 additions and 0 deletions.
    117 changes: 117 additions & 0 deletions __usage.adoc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,117 @@
    == Usage

    Use latest Neo4j for best results, e.g. 2.2.2 or 2.3.0-M02 (http://neo4j.com/download)
    On a machine with 12 cores use concurrency 24

    ==== Create 1 node, 1 rel, 1 property per request, 1M requests

    Total: 1M nodes, rels, props

    ----
    ./run_ab.sh 24 1000000 create_1.json
    ----

    ==== Results

    Requests per second: 18881.14 [#/sec] (mean) -> 19k nodes, rels, props / s
    Time taken for tests: 52.963 seconds -> 1M / 52s = 19k / s


    ----
    Server Software: Jetty(9.2.4.v20141103)
    Server Hostname: 127.0.0.1
    Server Port: 7474
    Document Path: /db/data/transaction/commit
    Document Length: 50 bytes
    Concurrency Level: 24
    Time taken for tests: 52.963 seconds
    Complete requests: 1000000
    Failed requests: 0
    Keep-Alive requests: 1000000
    Total transferred: 246000000 bytes
    Total body sent: 276000000
    HTML transferred: 50000000 bytes
    Requests per second: 18881.14 [#/sec] (mean)
    Time per request: 1.271 [ms] (mean)
    Time per request: 0.053 [ms] (mean, across all concurrent requests)
    Transfer rate: 4535.90 [Kbytes/sec] received
    5089.06 kb/s sent
    9624.96 kb/s total
    Connection Times (ms)
    min mean[+/-sd] median max
    Connect: 0 0 0.0 0 1
    Processing: 0 1 0.9 1 82
    Waiting: 0 1 0.9 1 82
    Total: 0 1 0.9 1 82
    Percentage of the requests served within a certain time (ms)
    50% 1
    66% 1
    75% 1
    80% 1
    90% 1
    95% 1
    98% 2
    99% 3
    100% 82 (longest request)
    ----

    ==== create 100 node, 100 rel, 100 props per request, 100k requests

    Total 10M nodes, rels, props

    ----
    ./run_ab.sh 24 100000 create_100.json
    ----

    ==== Results

    Requests per second: 4809.64 [#/sec] (mean) -> 480k nodes, rels, props / s
    Time taken for tests: 20.792 seconds -> 10M / 21s = 480k / s



    ----
    Server Software: Jetty(9.2.4.v20141103)
    Server Hostname: 127.0.0.1
    Server Port: 7474
    Document Path: /db/data/transaction/commit
    Document Length: 60 bytes
    Concurrency Level: 24
    Time taken for tests: 20.792 seconds
    Complete requests: 100000
    Failed requests: 0
    Keep-Alive requests: 100000
    Total transferred: 25600000 bytes
    Total body sent: 30700000
    HTML transferred: 6000000 bytes
    Requests per second: 4809.64 [#/sec] (mean)
    Time per request: 4.990 [ms] (mean)
    Time per request: 0.208 [ms] (mean, across all concurrent requests)
    Transfer rate: 1202.41 [Kbytes/sec] received
    1441.95 kb/s sent
    2644.37 kb/s total
    Connection Times (ms)
    min mean[+/-sd] median max
    Connect: 0 0 0.0 0 1
    Processing: 1 5 8.3 5 208
    Waiting: 1 5 8.3 5 208
    Total: 1 5 8.3 5 208
    Percentage of the requests served within a certain time (ms)
    50% 5
    66% 5
    75% 5
    80% 5
    90% 6
    95% 7
    98% 11
    99% 12
    100% 208 (longest request)
    ----
  3. @jexp jexp revised this gist Apr 15, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions _run_ab.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    # usage ./_run_ab.sh 4 10000 create_plain.json
    CONCURRENT=${1-10}
    REQUESTS=${2-10000}
    COMMAND=${3-postquery.json}
  4. @jexp jexp revised this gist Apr 15, 2015. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  5. @jexp jexp created this gist Apr 15, 2015.
    1 change: 1 addition & 0 deletions create_1.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"statements":[{"statement":"CREATE (_0 {type:'Bike'}), (_0)-[:REL]->(_0)"}]}
    1 change: 1 addition & 0 deletions create_100.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"statements":[{"statement":"FOREACH (r in range(1,100) | CREATE (_0 {type:'Bike'}), (_0)-[:REL]->(_0))"}]}
    1 change: 1 addition & 0 deletions create_label.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"statements":[{"statement":"CREATE (_0:`Bike`), (_1:`Wheel`), (_2:`Wheel`), (_0)-[:WHEELS]->(_1), (_0)-[:WHEELS]->(_2) RETURN id(_0) AS _0, id(_1) AS _1, id(_2) AS _2","parameters":{},"resultDataContents":["row"]}]}
    1 change: 1 addition & 0 deletions create_plain.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"statements":[{"statement":"CREATE (_0 {type:'Bike'}), (_1 {type:'Wheel'}), (_2 {type:'Wheel'}), (_0)-[:WHEELS]->(_1), (_0)-[:WHEELS]->(_2) RETURN id(_0) AS _0, id(_1) AS _1, id(_2) AS _2","parameters":{},"resultDataContents":["row"]}]}
    1 change: 1 addition & 0 deletions fof.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"statements":[{"statement":"MATCH (me:User {username:'Kaylee83639'})-[:FRIENDS]-(people:User)-[:FRIENDS]-(fof:User) WHERE me <> fof and not(me)-[:FRIENDS]-(fof) return fof,count(*) as freq order by freq desc limit 10;"}]}
    1 change: 1 addition & 0 deletions max.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"statements":[{"statement":"MATCH (me:User {username:'Kaylee83639'})-[:FRIENDS]-(people) RETURN people.username"}]}
    12 changes: 12 additions & 0 deletions perftest.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    function run {
    echo "{\"statements\":[{\"statement\":\"$1\"}]}" > perf_test.json
    echo "Query: $1" >> perf_results.txt
    ab -c ${3-4} -n ${2-10000} -p perf_test.json -T application/json -A neo4j:$4 -H accept:application/json http://127.0.0.1:7474/db/data/transaction/commit | tee -a perf_results.txt
    }
    CONCURRENCY=4
    REQUESTS=10000
    PWD=admin
    echo "Performance Test Northwind: concurrency $CONCURRENCY requests: $REQUESTS " > perf_results.txt
    run 'MATCH (c:Category {categoryName:'Produce'})<--(:Product)<--(s:Supplier) RETURN DISTINCT s.companyName as ProduceSuppliers' $REQUESTS $CONCURRENCY $PWD
    run 'MATCH (s:Supplier)-->(:Product)-->(c:Category) RETURN s.companyName as Company, collect(distinct c.categoryName) as Categories' $REQUESTS $CONCURRENCY $PWD
    run 'MATCH (cust:Customer)-[:PURCHASED]->(:Order)-[o:ORDERS]->(p:Product), (p)-[:PART_OF]->(c:Category {categoryName:"Produce"}) RETURN DISTINCT cust.contactName as CustomerName, SUM(o.quantity) AS TotalProductsPurchased' $REQUESTS $CONCURRENCY $PWD
    4 changes: 4 additions & 0 deletions run_ab.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    CONCURRENT=${1-10}
    REQUESTS=${2-10000}
    COMMAND=${3-postquery.json}
    ab -k -c $CONCURRENT -n $REQUESTS -p $COMMAND -T application/json -H accept:application/json http://127.0.0.1:9474/db/data/transaction/commit
    1 change: 1 addition & 0 deletions simple_lookup.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"statements":[{"statement":"MATCH (n) WHERE id(n) = 10 return id(n)"}]}