├── README.md └── benchmark ├── arangodb ├── ArangoTask.class ├── README ├── arangodb-java-driver-4.7.0-SNAPSHOT-standalone.jar ├── graph500-22-seed ├── khop.class ├── khop.java ├── load_graph500.sh ├── load_twitter.sh ├── pg_graph500.js ├── pg_twitter.js ├── result │ ├── khopResults_graph500_1_mm │ ├── khopResults_graph500_1_rock │ ├── khopResults_graph500_2_mm │ ├── khopResults_graph500_2_rock │ ├── khopResults_graph500_3_mm │ ├── khopResults_graph500_3_rock │ ├── khopResults_graph500_6_mm │ ├── khopResults_graph500_6_rock │ ├── khopResults_twitter_1_rock │ ├── khopResults_twitter_2_rock │ ├── khopResults_twitter_3_rock │ ├── khopResults_twitter_6_rock │ ├── pagerankResults_graph500_0_mm │ ├── pagerankResults_graph500_0_rock │ ├── pagerankResults_graph500_1_mm │ ├── pagerankResults_graph500_1_rock │ ├── pagerankResults_graph500_2_mm │ ├── pagerankResults_graph500_2_rock │ ├── pagerankResults_graph500_mm │ ├── pagerankResults_graph500_rock │ ├── wccResults_graph500_0_mm │ ├── wccResults_graph500_0_rock │ ├── wccResults_graph500_1_mm │ ├── wccResults_graph500_1_rock │ ├── wccResults_graph500_2_mm │ ├── wccResults_graph500_2_rock │ ├── wccResults_graph500_mm │ └── wccResults_graph500_rock ├── run_khop.sh ├── run_pg_wcc.sh ├── slf4j-simple-1.7.25.jar ├── twitter_rv.net-seed ├── wcc_graph500.js └── wcc_twitter.js ├── janusgraph ├── FileSplitor.java ├── JanusKNeighbor.java ├── PG │ ├── JanusPG$1.class │ ├── JanusPageRank$1.class │ ├── JanusPageRank.java │ ├── PG$1.class │ ├── PG$Builder.class │ ├── PG.java │ └── PageRankMessageCombiner.java ├── README ├── WCC-janus.sh ├── WCC │ ├── JanusWCC$1.class │ ├── JanusWCC.java │ ├── JanusWeaklyConnectedComponent$1.class │ ├── WCC$1.class │ ├── WCC$Builder.class │ ├── WCC.java │ ├── WCCMessageCombiner.class │ └── WCCMessageCombiner.java ├── compile_PG.sh ├── compile_WCC.sh ├── compile_load_knn.sh ├── dedup.java ├── edge_graph500_multi_threads.sh ├── edge_loader_twitter.sh ├── graph500-22-seed ├── graph500-janusgraph-cassandra.properties ├── knn-janus.sh ├── load_graph500_single_thread.sh ├── multiThreadEdgeImporter.java ├── multiThreadVertexImporter.java ├── pg-janus.sh ├── result │ ├── KN-latency-graph500-Traversal-1 │ ├── KN-latency-graph500-Traversal-2 │ ├── KN-latency-graph500-Traversal-3 │ ├── KN-latency-graph500-Traversal-6 │ ├── KN-latency-twitter-Traversal-1 │ ├── KN-latency-twitter-Traversal-2 │ ├── KN-latency-twitter-Traversal-3 │ ├── KN-latency-twitter-Traversal-6 │ ├── PageRank-latency-Graph500-16threads │ ├── PageRank-latency-Graph500-1thread │ ├── PageRank-latency-Graph500-4threads-1 │ ├── PageRank-latency-Graph500-4threads-2 │ ├── PageRank-latency-Graph500-4threads-3 │ ├── PageRank-latency-Graph500-8threads │ ├── WCC-latency-Graph500-1 │ ├── WCC-latency-Graph500-2 │ └── WCC-latency-Graph500-3 ├── singleThreadEdgeImporter.java ├── singleThreadGraph500Importer.java ├── singleThreadVertexImporter.java ├── twitter-janusgraph-cassandra.properties ├── twitter_rv.net-seed └── vertex_loader.sh ├── neo4j ├── README ├── config.py ├── graph500-22-seed ├── kn.py ├── kn.sh ├── neo4j.conf ├── neo4j_load_graph500.sh ├── neo4j_load_twitter.sh ├── pg.py ├── query_runner.py ├── result │ ├── KN-latency-neo4j-graph500-22-seed-k1 │ ├── KN-latency-neo4j-graph500-22-seed-k2 │ ├── KN-latency-neo4j-graph500-22-seed-k3 │ ├── KN-latency-neo4j-graph500-22-seed-k6 │ ├── KN-latency-neo4j-twitter_rv.net-seed-k1 │ ├── KN-latency-neo4j-twitter_rv.net-seed-k2 │ ├── KN-latency-neo4j-twitter_rv.net-seed-k3 │ ├── KN-latency-neo4j-twitter_rv.net-seed-k6 │ ├── PG-latency-neo4j-graph500-22 │ ├── PG-latency-neo4j-twitter-rv │ ├── WCC-latency-neo4j-graph500-22 │ ├── WCC-latency-neo4j-twitter-rv │ ├── graph500-loading.result │ └── twitter-loading.result ├── twitter_rv.net-seed └── wcc.py ├── neptune ├── README ├── cancel_loading.sh ├── check_load.sh ├── graph500-22-seed ├── json.jar ├── kn.java ├── load.sh ├── result │ ├── 4xlarge-KN-latency-Graph500-1 │ ├── 4xlarge-KN-latency-Graph500-2 │ ├── 4xlarge-KN-latency-Graph500-3 │ ├── 4xlarge-KN-latency-Graph500-6 │ ├── 4xlarge-KN-latency-Twitter-1 │ ├── 4xlarge-KN-latency-Twitter-2 │ ├── 4xlarge-KN-latency-Twitter-3 │ ├── 4xlarge-KN-latency-Twitter-6 │ ├── 8xlarge-KN-latency-Graph500-1 │ ├── 8xlarge-KN-latency-Graph500-2 │ ├── 8xlarge-KN-latency-Graph500-3 │ ├── 8xlarge-KN-latency-Graph500-6 │ ├── 8xlarge-KN-latency-Twitter-1 │ ├── 8xlarge-KN-latency-Twitter-2 │ ├── 8xlarge-KN-latency-Twitter-3 │ └── 8xlarge-KN-latency-Twitter-6 ├── twitter_rv.net-seed └── upload.sh └── tigergraph ├── ExprFunctions.hpp ├── README ├── benchmark-graph500.sh ├── benchmark-twitter.sh ├── cluster_config.json ├── config.py ├── graph500-22-seed ├── graph500_setup.gsql ├── khop.gsql ├── kn-graph500.gsql ├── kn-twitter.gsql ├── kn.py ├── pg-graph500.gsql ├── pg-twitter-distributed.gsql ├── pg-twitter.gsql ├── pg.py ├── query_runner.py ├── result ├── KN-latency-tigergraph-graph500-22-seed-k1 ├── KN-latency-tigergraph-graph500-22-seed-k2 ├── KN-latency-tigergraph-graph500-22-seed-k3 ├── KN-latency-tigergraph-graph500-22-seed-k6 ├── KN-latency-tigergraph-twitter_rv.net-seed-k1 ├── KN-latency-tigergraph-twitter_rv.net-seed-k2 ├── KN-latency-tigergraph-twitter_rv.net-seed-k3 ├── KN-latency-tigergraph-twitter_rv.net-seed-k6 ├── PG-latency-tigergraph-graph500-22 ├── PG-latency-tigergraph-twitter-rv ├── PG-latency-tigergraph-twitter-rv.1machine.r4.2xlarge ├── PG-latency-tigergraph-twitter-rv.2machine.r4.2xlarge ├── PG-latency-tigergraph-twitter-rv.4machine.r4.2xlarge ├── PG-latency-tigergraph-twitter-rv.6machine.r4.2xlarge ├── PG-latency-tigergraph-twitter-rv.8machine.r4.2xlarge ├── WCC-latency-tigergraph-graph500-22 ├── WCC-latency-tigergraph-twitter-rv ├── graph500-loading.result ├── twitter-loading.1machine.r4.2xlarge ├── twitter-loading.2machine.r4.2xlarge ├── twitter-loading.4machine ├── twitter-loading.4machine.r4.2xlarge ├── twitter-loading.6machine.r4.2xlarge ├── twitter-loading.8machine.r4.2xlarge └── twitter-loading.result ├── split_distribute.sh ├── twitter_rv.net-seed ├── twitter_setup.gsql ├── wcc-graph500.gsql ├── wcc-twitter.gsql └── wcc.py /README.md: -------------------------------------------------------------------------------- 1 | Graph Database Benchmark : Neo4j vs Amazon Neptune vs Titan vs TigerGraph vs JanusGraph vs Arangodb 2 | 3 | - same datasets 4 | - same query workload 5 | - same enviroment (hardware) 6 | - cross validation of result 7 | - each vendor's benchmark is under 8 | /benchmark/vendor_name/ 9 | - start with README under each folder 10 | - all test can be reproducible on EC2 or similar enviroment. 11 | 12 | Contact: benchmark@tigergraph.com 13 | -------------------------------------------------------------------------------- /benchmark/arangodb/ArangoTask.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/arangodb/ArangoTask.class -------------------------------------------------------------------------------- /benchmark/arangodb/README: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | 10 | This article documents the details on how to reproduce the graph database benchmark result on ArangoDB. 11 | 12 | Data Sets 13 | =========== 14 | 15 | - graph500 edge file: http://service.tigergraph.com/download/benchmark/dataset/graph500-22/graph500-22 16 | - graph500 vertex file: http://service.tigergraph.com/download/benchmark/dataset/graph500-22/graph500-22_unique_node 17 | 18 | - twitter edge file: http://service.tigergraph.com/download/benchmark/dataset/twitter/twitter_rv.tar.gz 19 | - twitter vertex file: http://service.tigergraph.com/download/benchmark/dataset/twitter/twitter_rv.net_unique_node 20 | 21 | 22 | Hardware & Major enviroment 23 | ================================ 24 | - Amazon EC2 machine r4.8xlarge. 25 | - OS Ubuntu 14.04.5 LTS 26 | - Java build 1.7.0_181 27 | - Python 2.7.6 28 | 29 | 30 | - 32vCPUs 31 | - 244GiB memory 32 | - attached a 300GiB EBS-optimized Provisioned IOPS SSD (IO1), we set IOPS to 15k. 33 | Raw data and arangodb datafiles are put on this SSD. 34 | 35 | ArangoDB Version 36 | ================== 37 | - 3.3.13 Community edition downloaded from https://download.arangodb.com/arangodb33/xUbuntu_14.04 38 | - Java driver arangodb-java-driver-4.7.0-SNAPSHOT-standalone.jar (downloaded from https://github.com/arangodb/arangodb-java-driver) 39 | - SLF4J loggig library slf4j-simple-1.7.25.jar (downloaded from https://www.slf4j.org/download.html) 40 | 41 | Install ArangoDB 42 | ================== 43 | # add repository key 44 | wget https://www.arangodb.com/repositories/arangodb33/xUbuntu_14.04/Release.key 45 | sudo apt-key add Release.key 46 | 47 | # add apt repository 48 | sudo apt-add-repository 'deb https://www.arangodb.com/repositories/arangodb33/xUbuntu_14.04/ /' 49 | sudo apt-get update 50 | 51 | # install ArangoDB 52 | # set password="root" for the root user 53 | # storage engine choose mmfiles or rocksdb (benchmark results provided for both storage options) 54 | sudo apt-get install arangodb3=3.3.13 55 | 56 | # check if installation went well 57 | curl http://root:root@localhost:8529/_api/version 58 | 59 | # output should look like this 60 | {"server":"arango","version":"3.3.13","license":"community"} 61 | 62 | Setup ebs volume as database directory for ArangoDB 63 | ===================================================== 64 | # switch to root 65 | sudo bash 66 | 67 | # create new database directory 68 | mkdir /ebs/arangodb 69 | chmod 777 -R /ebs 70 | 71 | # create symbolic link to this directory from ArangoDB default database directory /var/lib/arangodb3 72 | cd /var/lib 73 | mv arangodb3 /ebs/arangodb 74 | ln -s /ebs/arangodb/arangodb3/ arangodb3 75 | 76 | # exit root 77 | exit 78 | 79 | # restart arangodb 80 | sudo service arangodb3 restart 81 | 82 | Run benchmark 83 | ================ 84 | Download all files in the README folder to a script folder. 85 | 86 | Before running the benchmark script below, please make sure the current user has the READ permission from the raw file, 87 | and the WRITE permission on the folder where you put the benchmark script folder, since the random seed will be generted in this folder. 88 | 89 | You may consider to make ssh config to keep it alive by following, since the benchmark will run long time. 90 | https://www.howtogeek.com/howto/linux/keep-your-linux-ssh-session-from-disconnecting/ 91 | 92 | Load Data 93 | ----------------- 94 | Download dataset in the same folder where all the benchmark files are. 95 | 96 | # download graph500 dataset 97 | wget http://service.tigergraph.com/download/benchmark/dataset/graph500-22/graph500-22 98 | wget http://service.tigergraph.com/download/benchmark/dataset/graph500-22/graph500-22_unique_node 99 | 100 | 101 | # download twitter dataset 102 | wget http://service.tigergraph.com/download/benchmark/dataset/twitter/twitter_rv.tar.gz 103 | wget http://service.tigergraph.com/download/benchmark/dataset/twitter/twitter_rv.net_unique_node 104 | tar -xzf twitter_rv.tar.gz 105 | 106 | ArangoDB requires input files to have headers. 107 | 108 | # Add headers to graph500 dataset files 109 | sed -i '1i _key' graph500-22_unique_node 110 | sed -i '1i _from\t_to' graph500-22 111 | 112 | # Add headers to twitter dataset files 113 | sed -i '1i _key' twitter_rv.net_unique_node 114 | sed -i '1i _from\t_to' twitter_rv.net 115 | 116 | RUN load scripts. 117 | 118 | # to load graph500 data 119 | bash load_graph500.sh 120 | 121 | # to load twitter data 122 | bash load_twitter.sh 123 | 124 | CHECK storage size. 125 | 126 | # mmfiles engine 127 | # run this arangosh command to find out the id of a database to use it later (replace database_name) 128 | arangosh --server.database "database_name" --server.password "root" --javascript.execute-string "print(db._id())" 129 | 130 | # and now run these commands under root user (use database id retrieved earlier instead of database_id_number) 131 | cd /ebs/arangodb/arangodb3/databases 132 | du -hc database-database_id_number 133 | 134 | # rocksdb engine 135 | # run under root user (datafiles from all databases stored under the same folder) 136 | cd /ebs/arangodb/arangodb3 137 | du -hc engine-rocksdb 138 | 139 | Graph500 140 | ----------------- 141 | # khop (output file has format khopResults_graph500_k) 142 | # compile (if necessary) 143 | javac -cp \* khop.java 144 | 145 | # to run all khop queries on graph500 (k=1,2 average over 300 seeds, k=3,6 average over 10 seeds) 146 | bash run_khop.sh graph500 147 | 148 | # OR alternatively to run one query only use the following command with arguments 149 | java -cp .:\* khop graph_name depth timeout_seconds 150 | 151 | # examples 152 | java -cp .:\* khop graph500 1 180 153 | java -cp .:\* khop graph500 3 9000 154 | 155 | # wcc 156 | bash run_pg_wcc.sh graph500 wcc 157 | 158 | # pagerank 159 | bash run_pg_wcc.sh graph500 pagerank 160 | 161 | Twitter 162 | ------------- 163 | # khop (output file has format khopResults_twitter_k) 164 | # compile (if necessary) 165 | javac -cp \* khop.java 166 | 167 | # to run all khop queries on twitter (k=1,2 average over 300 seeds, k=3,6 average over 10 seeds) 168 | bash run_khop.sh twitter 169 | 170 | # OR alternatively to run one query only use the following command with arguments 171 | java -cp .:\* khop graph_name depth timeout_seconds 172 | 173 | # examples 174 | java -cp .:\* khop twitter 1 180 175 | java -cp .:\* khop twitter 3 9000 176 | 177 | # wcc 178 | bash run_pg_wcc.sh twitter wcc 179 | 180 | # pagerank 181 | bash run_pg_wcc.sh twitter pagerank 182 | -------------------------------------------------------------------------------- /benchmark/arangodb/arangodb-java-driver-4.7.0-SNAPSHOT-standalone.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/arangodb/arangodb-java-driver-4.7.0-SNAPSHOT-standalone.jar -------------------------------------------------------------------------------- /benchmark/arangodb/graph500-22-seed: -------------------------------------------------------------------------------- 1 | 3600312 2677094 2038005 3301167 704219 1779962 2681401 2277366 1649130 806220 3783689 3979771 2878950 1316789 4099483 2654216 3520283 320529 460890 2861567 1676721 3582851 2025534 1897682 3042164 683461 484783 2964318 825304 2303395 3029190 2119218 341236 3921645 3350720 1382338 2497566 2293317 1365818 3108349 1039487 656628 326459 3486463 1513849 3120768 3254104 2859677 4100533 1214662 2844418 3228461 2971789 838862 3242202 231946 103480 745855 2202837 121973 2944986 3916778 1237877 2404335 3903782 3753107 2638320 3532534 3026267 149529 2522099 1565761 1345848 1059426 2994540 1629629 1481421 337894 2706001 342515 2301230 3455722 4103891 2560844 316796 3853684 2803721 2782143 4168065 1297201 2982970 1089600 3589606 1978189 514482 773765 1929789 2499474 1367644 3052548 2020748 1934532 2595851 1265635 2678981 3484689 2778764 323958 1972929 2529296 2638682 2836761 3489646 2304697 3006908 3976118 432800 3408347 3184190 2478197 3990575 3097880 259436 479595 2054949 1014166 2398658 3499821 289302 2689848 603652 2764479 3458769 2372488 3826201 610619 1502380 1417031 1291296 1699680 1816799 2952048 3747093 996609 1906969 712790 1973404 2874441 4072076 534367 2419131 3145715 1172458 2547240 579284 3952328 3217974 928922 2975442 3686619 143324 2262470 2844253 3960743 95176 2661831 289798 498881 459455 3778765 2575099 2321106 898887 1630163 3268706 25081 3747551 2048028 1377545 2178454 3666746 1692598 1809240 1461949 3878592 96570 4095479 2539031 364055 3514283 3843398 3556803 2592596 168 2336570 327991 2445956 1140337 2663510 2514997 1933620 1076164 3734798 99836 2404509 3102298 2158818 3088473 3861233 1453810 1952126 968226 594138 1059034 408333 3246311 587844 1602562 2546319 2861944 1360827 1915610 957424 1427107 433135 3353932 140407 1989222 1392471 1290284 2144691 1299024 764990 302910 4192735 3181076 1535127 263980 1571976 2271738 492328 3976408 1621372 3024237 3229179 2167063 102878 4085765 2370758 2987431 2633916 1177859 1581601 18147 697579 3491436 699069 1608362 2570730 3929663 1304943 3733946 2216412 3013035 261001 32290 113329 1509856 2190260 3103760 3687843 1245035 3341532 857395 3942814 3982809 2807038 3291942 1840809 760204 3108890 1416278 3725922 2189358 2810970 655805 63077 3708992 2622204 1647516 1274701 2238470 83658 3800740 3659055 740181 318596 1353213 3058396 3497001 -------------------------------------------------------------------------------- /benchmark/arangodb/khop.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/arangodb/khop.class -------------------------------------------------------------------------------- /benchmark/arangodb/khop.java: -------------------------------------------------------------------------------- 1 | import java.util.Iterator; 2 | import java.util.Map; 3 | import java.io.BufferedReader; 4 | import java.io.FileWriter; 5 | import java.io.File; 6 | import java.io.FileReader; 7 | 8 | import java.util.concurrent.Callable; 9 | import java.util.concurrent.ExecutorService; 10 | import java.util.concurrent.Executors; 11 | import java.util.concurrent.Future; 12 | import java.util.concurrent.TimeUnit; 13 | import java.util.concurrent.TimeoutException; 14 | 15 | import com.arangodb.ArangoCollection; 16 | import com.arangodb.ArangoDBException; 17 | import com.arangodb.ArangoDatabase; 18 | import com.arangodb.ArangoCursor; 19 | import com.arangodb.ArangoDB; 20 | import com.arangodb.ArangoDBException; 21 | import com.arangodb.entity.BaseDocument; 22 | import com.arangodb.entity.CollectionEntity; 23 | import com.arangodb.util.MapBuilder; 24 | import com.arangodb.model.AqlQueryOptions; 25 | 26 | class ArangoTask implements Callable { 27 | private ArangoDB arangoDB = null; 28 | private ArangoDatabase db = null; 29 | private int depth = 0; 30 | private String root = ""; 31 | public ArangoTask(String dbName, int depth, String root){ 32 | this.arangoDB = new ArangoDB.Builder().user("root").password("root").build(); 33 | this.db = arangoDB.db(dbName); 34 | this.depth = depth; 35 | this.root = root; 36 | } 37 | @Override 38 | public long[] call() throws Exception { 39 | 40 | String query = "FOR v IN "+depth+".."+depth+" OUTBOUND 'vertex/"+root+"' edge RETURN distinct v._id"; 41 | long startTime = System.nanoTime(); 42 | ArangoCursor cursor = db.query(query, null, new AqlQueryOptions().count(true), String.class); 43 | long endTime = System.nanoTime(); 44 | long diff = (endTime - startTime)/1000000; 45 | arangoDB.shutdown(); 46 | 47 | return new long[]{cursor.count(), diff}; 48 | } 49 | } 50 | 51 | public class khop { 52 | 53 | 54 | public static void main(String[] args) { 55 | 56 | if (args.length == 0 || args.length < 3){ 57 | System.out.println("Provide graph name (graph500, twitter), depth (1,2,3,6) AND timeout in seconds"); 58 | System.exit(0); 59 | } 60 | 61 | String dbName = args[0]; 62 | int depth = Integer.parseInt(args[1]); 63 | int timeout = Integer.parseInt(args[2]); 64 | String seedFile = "graph500-22-seed"; 65 | if (dbName.equals("twitter")){ 66 | seedFile = "twitter_rv.net-seed"; 67 | } 68 | try { 69 | // reed seeds 70 | File file = new File(seedFile); 71 | FileReader fileReader = new FileReader(file); 72 | BufferedReader bufferedReader = new BufferedReader(fileReader); 73 | StringBuffer stringBuffer = new StringBuffer(); 74 | String line = bufferedReader.readLine(); 75 | String[] roots = line.split(" "); 76 | 77 | //file to write results 78 | FileWriter writer = new FileWriter("khopResults_" + dbName + "_" + depth); 79 | writer.write("k-hop query with depth = " + depth + "\n"); 80 | writer.write("start vertex,\tneighbor size,\tquery time (in ms)\n"); 81 | 82 | long totalSize = 0; 83 | double totalTime = 0.0; 84 | int errorQuery = 0; 85 | int totalQuery = 0; 86 | long[] result = new long[0];; 87 | for(String root:roots) { 88 | 89 | // for depth 3 qnd 6 only need to run 10 queries 90 | if (depth > 2 && totalQuery == 10){ 91 | break; 92 | } 93 | 94 | totalQuery++; 95 | ArangoTask arangoTask = new ArangoTask(dbName, depth, root); 96 | ExecutorService executor = Executors.newSingleThreadExecutor(); 97 | Future future = executor.submit(arangoTask); 98 | try { 99 | System.out.println("Starting...seed=" + root); 100 | result = future.get(timeout, TimeUnit.SECONDS); 101 | System.out.println("Finished!"); 102 | } catch (TimeoutException e) { 103 | future.cancel(true); 104 | result = new long[]{-1, -1}; 105 | errorQuery++; 106 | System.out.println("TIMEOUT: query terminated!"); 107 | } catch (Exception e){ 108 | System.out.println("Failed to terminate:" + e.getMessage()); 109 | } 110 | 111 | executor.shutdownNow(); 112 | if (result[0] != -1){ 113 | totalSize += result[0]; 114 | totalTime += result[1]; 115 | } 116 | 117 | writer.write(root + ",\t" + Long.toString(result[0]) + ",\t" + Long.toString(result[1]) + "\n"); 118 | writer.flush(); 119 | 120 | } 121 | double avgSize = totalQuery == errorQuery ? -1.0 : (double)totalSize/(double)(totalQuery-errorQuery); 122 | double avgTime = totalQuery == errorQuery ? -1.0 : totalTime/(double)(totalQuery-errorQuery); 123 | System.out.println("===================SUMMARY=================================\n"); 124 | System.out.println("Total "+ depth + "-Neighborhood size: " + totalSize); 125 | System.out.println("Total elapsed time, ms: " + totalTime); 126 | System.out.println("Total number of queries: " + totalQuery); 127 | System.out.println("Number of failed queries: " + errorQuery); 128 | System.out.println("Average " + depth + "-Neighborhood size: " + avgSize); 129 | System.out.println("Average query time, ms: " + avgTime); 130 | 131 | writer.write("===================SUMMARY=================================\n"); 132 | writer.write("Total number of queries:\t" + totalQuery + "\n" + "Total elapsed time, ms:\t" + totalTime + "\n" + "Total Neighborhood size:\t" + totalSize + "\n" + "Total number of failed queries:\t" + errorQuery + "\n" + "Average Neighborhood size:\t" + avgSize + "\n" + "Average query time, ms:\t" + avgTime + "\n"); 133 | writer.flush(); 134 | writer.close(); 135 | } catch (Exception e) { 136 | e.printStackTrace(); 137 | } 138 | System.out.println("Done!"); 139 | System.exit(0); 140 | 141 | } 142 | 143 | 144 | } 145 | 146 | -------------------------------------------------------------------------------- /benchmark/arangodb/load_graph500.sh: -------------------------------------------------------------------------------- 1 | echo "Load dataset: graph500" 2 | 3 | echo "Create database: graph500" 4 | arangosh --server.username "root" --server.password "root" --javascript.execute-string "print(db._createDatabase('graph500'))" 5 | 6 | # Use --threads 16 for rocksdb storage engine 7 | echo "Load vertex collection ..." 8 | time arangoimp --file graph500-22_unique_node --collection vertex --create-collection true --type tsv --server.password "root" --server.database "graph500" --threads 16 9 | 10 | # Use --threads 16 for rocksdb storage engine 11 | echo "Load edge collection ..." 12 | time arangoimp --file graph500-22 --collection edge --create-collection true --type tsv --create-collection-type edge --from-collection-prefix vertex --to-collection-prefix vertex --server.password "root" --server.database "graph500" --threads 16 13 | 14 | echo "Load complete!" 15 | -------------------------------------------------------------------------------- /benchmark/arangodb/load_twitter.sh: -------------------------------------------------------------------------------- 1 | echo "Load dataset: twitter" 2 | 3 | echo "Create database: twitter" 4 | arangosh --server.username "root" --server.password "root" --javascript.execute-string "print(db._createDatabase('twitter'))" 5 | 6 | # Use --threads 16 for rocksdb storage engine 7 | echo "Load vertex collection ..." 8 | time arangoimp --file twitter_rv.net_unique_node --collection vertex --create-collection true --type tsv --server.password "root" --server.database "twitter" --threads 16 9 | 10 | echo "Load edge collection ..." 11 | # Use --threads 16 for rocksdb storage engine and timeouts set in seconds 12 | time arangoimp --file twitter_rv.net --collection edge --create-collection true --type tsv --create-collection-type edge --from-collection-prefix vertex --to-collection-prefix vertex --server.password "root" --server.database "twitter" --server.connection-timeout 86400 --server.request-timeout 86400 --threads 16 13 | 14 | echo "Load complete!" 15 | -------------------------------------------------------------------------------- /benchmark/arangodb/pg_graph500.js: -------------------------------------------------------------------------------- 1 | const pregel = require("@arangodb/pregel") 2 | var graph_module = require("@arangodb/general-graph") 3 | var fs = require("fs"); 4 | 5 | if (graph_module._exists("graph500")){ 6 | graph_module._drop("graph500") 7 | } 8 | 9 | var graph = graph_module._create("graph500"); 10 | 11 | graph._addVertexCollection("vertex"); 12 | var rel = graph_module._relation("edge", ["vertex"], ["vertex"]); 13 | graph._extendEdgeDefinitions(rel); 14 | 15 | var totalTime = 0; 16 | var total = 0; 17 | 18 | for (var i=0; i<3; i++) { 19 | var handle = pregel.start("pagerank", "graph500", {maxGSS: 10, resultField:"pagerank"}); 20 | 21 | total++; 22 | 23 | print("computing pagerank: Test # " + total); 24 | while (!["done", "canceled"].includes(pregel.status(handle).state)) { 25 | print("waiting to complete... Test # " + total); 26 | require("internal").wait(0.5); 27 | } 28 | 29 | 30 | var status = pregel.status(handle); 31 | print(status); 32 | if (status.state == "done") { 33 | totalTime += status.totalRuntime; 34 | fs.writeFileSync("pagerankResults_graph500_" + i, "Test#" + i + ", " + status.totalRuntime+" s"); 35 | } 36 | 37 | 38 | } 39 | 40 | print("SUMMARY PageRank for graph500:"); 41 | print("Total time, s: " + totalTime); 42 | print("Total number of tests: " + total); 43 | print("Avg time, s: ", totalTime/total); 44 | fs.writeFileSync("pagerankResults_graph500", "Avg time, s: " + totalTime/total); 45 | -------------------------------------------------------------------------------- /benchmark/arangodb/pg_twitter.js: -------------------------------------------------------------------------------- 1 | const pregel = require("@arangodb/pregel") 2 | var graph_module = require("@arangodb/general-graph") 3 | var fs = require("fs"); 4 | 5 | if (graph_module._exists("twitter")){ 6 | graph_module._drop("twitter") 7 | } 8 | 9 | var graph = graph_module._create("twitter"); 10 | 11 | graph._addVertexCollection("vertex"); 12 | var rel = graph_module._relation("edge", ["vertex"], ["vertex"]); 13 | graph._extendEdgeDefinitions(rel); 14 | 15 | var totalTime = 0; 16 | var total = 0; 17 | 18 | 19 | for (var i=0; i<3; i++) { 20 | var handle = pregel.start("pagerank", "twitter", {maxGSS: 10, resultField:"pagerank"}); 21 | 22 | total++; 23 | 24 | print("computing pagerank: Test # " + total); 25 | while (!["done", "canceled"].includes(pregel.status(handle).state)) { 26 | print("waiting to complete... Test # " + total); 27 | require("internal").wait(0.5); 28 | } 29 | 30 | 31 | var status = pregel.status(handle); 32 | print(status); 33 | if (status.state == "done") { 34 | totalTime += status.totalRuntime; 35 | fs.writeFileSync("pagerankResults_twitter_" + i, "Test#" + i + ", " + status.totalRuntime+" s"); 36 | } 37 | 38 | 39 | } 40 | 41 | print("SUMMARY PageRank for twitter graph:"); 42 | print("Total time, s: " + totalTime); 43 | print("Total number of tests: " + total); 44 | print("Avg time, s: ", totalTime/total); 45 | fs.writeFileSync("pagerankResults_twitter", "Avg time, s: " + totalTime/total); 46 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/khopResults_graph500_1_mm: -------------------------------------------------------------------------------- 1 | k-hop query with depth = 1 2 | start vertex, neighbor size, query time (in ms) 3 | 3600312, 723, 65 4 | 2677094, 82, 3 5 | 2038005, 257, 5 6 | 3301167, 2691, 17 7 | 704219, 7, 3 8 | 1779962, 669, 7 9 | 2681401, 8532, 34 10 | 2277366, 809, 8 11 | 1649130, 967, 10 12 | 806220, 2101, 15 13 | 3783689, 868, 6 14 | 3979771, 23306, 86 15 | 2878950, 2397, 18 16 | 1316789, 91, 4 17 | 4099483, 158, 3 18 | 2654216, 2935, 17 19 | 3520283, 68, 4 20 | 320529, 940, 8 21 | 460890, 1213, 10 22 | 2861567, 18, 4 23 | 1676721, 997, 17 24 | 3582851, 61, 4 25 | 2025534, 1596, 14 26 | 1897682, 79, 5 27 | 3042164, 91, 5 28 | 683461, 8913, 38 29 | 484783, 1675, 9 30 | 2964318, 2, 4 31 | 825304, 92, 4 32 | 2303395, 22950, 84 33 | 3029190, 201, 5 34 | 2119218, 2930, 18 35 | 341236, 7391, 28 36 | 3921645, 160, 3 37 | 3350720, 11325, 46 38 | 1382338, 2624, 12 39 | 2497566, 6704, 26 40 | 2293317, 91, 3 41 | 1365818, 226, 3 42 | 3108349, 248, 4 43 | 1039487, 84, 3 44 | 656628, 1941, 11 45 | 326459, 161, 4 46 | 3486463, 838, 8 47 | 1513849, 576, 7 48 | 3120768, 26, 4 49 | 3254104, 1812, 12 50 | 2859677, 47, 4 51 | 4100533, 6961, 25 52 | 1214662, 969, 8 53 | 2844418, 2016, 9 54 | 3228461, 29, 4 55 | 2971789, 2509, 15 56 | 838862, 227, 4 57 | 3242202, 67601, 271 58 | 231946, 49, 2 59 | 103480, 1247, 8 60 | 745855, 81, 4 61 | 2202837, 542, 7 62 | 121973, 1710, 14 63 | 2944986, 5778, 26 64 | 3916778, 6272, 26 65 | 1237877, 28, 2 66 | 2404335, 189, 3 67 | 3903782, 18494, 63 68 | 3753107, 21916, 78 69 | 2638320, 8615, 33 70 | 3532534, 4484, 18 71 | 3026267, 7979, 28 72 | 149529, 2, 3 73 | 2522099, 292, 3 74 | 1565761, 2165, 12 75 | 1345848, 708, 8 76 | 1059426, 504, 7 77 | 2994540, 9118, 35 78 | 1629629, 6958, 25 79 | 1481421, 2811, 12 80 | 337894, 804, 8 81 | 2706001, 467, 6 82 | 342515, 2739, 19 83 | 2301230, 673, 5 84 | 3455722, 2248, 16 85 | 4103891, 215, 5 86 | 2560844, 2114, 15 87 | 316796, 885, 8 88 | 3853684, 173, 4 89 | 2803721, 525, 6 90 | 2782143, 60, 3 91 | 4168065, 98, 4 92 | 1297201, 247, 5 93 | 2982970, 163501, 878 94 | 1089600, 2349, 16 95 | 3589606, 28, 3 96 | 1978189, 2700, 17 97 | 514482, 1430, 10 98 | 773765, 65, 5 99 | 1929789, 73, 4 100 | 2499474, 25325, 93 101 | 1367644, 2763, 16 102 | 3052548, 2991, 16 103 | 2020748, 611, 6 104 | 1934532, 296, 4 105 | 2595851, 1227, 10 106 | 1265635, 682, 8 107 | 2678981, 147, 4 108 | 3484689, 709, 8 109 | 2778764, 270, 4 110 | 323958, 883, 7 111 | 1972929, 2, 3 112 | 2529296, 6922, 28 113 | 2638682, 102, 4 114 | 2836761, 736, 5 115 | 3489646, 24586, 93 116 | 2304697, 25538, 93 117 | 3006908, 53, 3 118 | 3976118, 8280, 32 119 | 432800, 133, 4 120 | 3408347, 805, 5 121 | 3184190, 57, 3 122 | 2478197, 98, 4 123 | 3990575, 986, 6 124 | 3097880, 13, 3 125 | 259436, 2841, 16 126 | 479595, 44, 2 127 | 2054949, 20, 2 128 | 1014166, 36, 2 129 | 2398658, 695, 4 130 | 3499821, 8717, 29 131 | 289302, 25637, 91 132 | 2689848, 769, 4 133 | 603652, 264, 3 134 | 2764479, 712, 7 135 | 3458769, 250, 4 136 | 2372488, 14, 3 137 | 3826201, 94, 3 138 | 610619, 7341, 26 139 | 1502380, 623, 5 140 | 1417031, 8246, 31 141 | 1291296, 67379, 274 142 | 1699680, 834, 7 143 | 1816799, 22, 2 144 | 2952048, 25084, 94 145 | 3747093, 68, 3 146 | 996609, 846, 8 147 | 1906969, 141, 2 148 | 712790, 25261, 94 149 | 1973404, 22, 2 150 | 2874441, 198, 3 151 | 4072076, 216, 3 152 | 534367, 18, 2 153 | 2419131, 11375, 44 154 | 3145715, 213, 3 155 | 1172458, 838, 6 156 | 2547240, 1929, 13 157 | 579284, 2917, 16 158 | 3952328, 6, 2 159 | 3217974, 6340, 22 160 | 928922, 2583, 14 161 | 2975442, 421, 4 162 | 3686619, 99, 2 163 | 143324, 101, 2 164 | 2262470, 1235, 8 165 | 2844253, 210, 3 166 | 3960743, 34, 2 167 | 95176, 27, 2 168 | 2661831, 62, 3 169 | 289798, 7961, 31 170 | 498881, 1364, 8 171 | 459455, 29, 3 172 | 3778765, 25507, 91 173 | 2575099, 315, 4 174 | 2321106, 20273, 71 175 | 898887, 8936, 34 176 | 1630163, 2254, 12 177 | 3268706, 270, 3 178 | 25081, 230, 3 179 | 3747551, 915, 5 180 | 2048028, 699, 6 181 | 1377545, 7796, 29 182 | 2178454, 25231, 89 183 | 3666746, 463, 5 184 | 1692598, 213, 2 185 | 1809240, 29, 1 186 | 1461949, 984, 9 187 | 3878592, 306, 4 188 | 96570, 572, 6 189 | 4095479, 7461, 30 190 | 2539031, 328, 3 191 | 364055, 2880, 18 192 | 3514283, 8739, 32 193 | 3843398, 667, 6 194 | 3556803, 338, 3 195 | 2592596, 2779, 12 196 | 168, 2978, 17 197 | 2336570, 58, 2 198 | 327991, 2664, 13 199 | 2445956, 7478, 29 200 | 1140337, 22973, 80 201 | 2663510, 65106, 265 202 | 2514997, 756, 7 203 | 1933620, 9066, 36 204 | 1076164, 8471, 33 205 | 3734798, 66, 2 206 | 99836, 823, 8 207 | 2404509, 2413, 11 208 | 3102298, 80, 2 209 | 2158818, 9068, 32 210 | 3088473, 15, 2 211 | 3861233, 204, 3 212 | 1453810, 4, 1 213 | 1952126, 373, 3 214 | 968226, 2213, 14 215 | 594138, 2274, 10 216 | 1059034, 823, 7 217 | 408333, 13, 2 218 | 3246311, 10, 2 219 | 587844, 1855, 13 220 | 1602562, 174, 3 221 | 2546319, 8471, 34 222 | 2861944, 898, 8 223 | 1360827, 67265, 274 224 | 1915610, 4392, 20 225 | 957424, 3181, 15 226 | 1427107, 53, 2 227 | 433135, 88, 2 228 | 3353932, 628, 4 229 | 140407, 863, 5 230 | 1989222, 753, 7 231 | 1392471, 23602, 86 232 | 1290284, 8027, 31 233 | 2144691, 18311, 69 234 | 1299024, 44, 2 235 | 764990, 880, 5 236 | 302910, 1225, 10 237 | 4192735, 829, 7 238 | 3181076, 658, 6 239 | 1535127, 2818, 15 240 | 263980, 1690, 9 241 | 1571976, 924, 7 242 | 2271738, 1766, 12 243 | 492328, 1615, 6 244 | 3976408, 216, 2 245 | 1621372, 731, 4 246 | 3024237, 90, 2 247 | 3229179, 62056, 234 248 | 2167063, 24706, 88 249 | 102878, 2920, 12 250 | 4085765, 756, 5 251 | 2370758, 92, 2 252 | 2987431, 24070, 84 253 | 2633916, 240, 2 254 | 1177859, 25586, 95 255 | 1581601, 8960, 34 256 | 18147, 2839, 17 257 | 697579, 137, 2 258 | 3491436, 2932, 14 259 | 699069, 472, 3 260 | 1608362, 721, 4 261 | 2570730, 2772, 12 262 | 3929663, 21812, 77 263 | 1304943, 1491, 8 264 | 3733946, 6672, 22 265 | 2216412, 8577, 31 266 | 3013035, 26, 2 267 | 261001, 125, 2 268 | 32290, 23475, 81 269 | 113329, 8993, 30 270 | 1509856, 8320, 33 271 | 2190260, 515, 5 272 | 3103760, 866, 8 273 | 3687843, 2456, 13 274 | 1245035, 3, 2 275 | 3341532, 1724, 12 276 | 857395, 1702, 11 277 | 3942814, 3232, 15 278 | 3982809, 318, 4 279 | 2807038, 2806, 17 280 | 3291942, 242, 2 281 | 1840809, 3154, 15 282 | 760204, 47, 2 283 | 3108890, 4, 1 284 | 1416278, 53, 2 285 | 3725922, 25513, 88 286 | 2189358, 2842, 18 287 | 2810970, 359, 3 288 | 655805, 287, 3 289 | 63077, 2172, 13 290 | 3708992, 8508, 34 291 | 2622204, 31, 1 292 | 1647516, 529, 3 293 | 1274701, 511, 7 294 | 2238470, 1118, 9 295 | 83658, 928, 8 296 | 3800740, 6111, 26 297 | 3659055, 921, 8 298 | 740181, 2691, 15 299 | 318596, 18172, 63 300 | 1353213, 641, 6 301 | 3058396, 275, 3 302 | 3497001, 212, 4 303 | ===================SUMMARY================================= 304 | Total number of queries: 300 305 | Total elapsed time, ms: 6912.0 306 | Total Neighborhood size: 1538526 307 | Total number of failed queries: 0 308 | Average Neighborhood size: 5128 309 | Average query time, ms: 23.04 310 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/khopResults_graph500_3_mm: -------------------------------------------------------------------------------- 1 | k-hop query with depth = 3 2 | start vertex, neighbor size, query time (in ms) 3 | 3600312, 1519273, 1640627 4 | 2677094, 285633, 9453 5 | 2038005, 1553376, 712431 6 | 3301167, -1, -1 7 | 704219, 26549, 140 8 | 1779962, 1520027, 2201719 9 | 2681401, -1, -1 10 | 2277366, 1682414, 2773462 11 | 1649130, -1, -1 12 | 806220, 1532485, 5646273 13 | ===================SUMMARY================================= 14 | Total number of queries: 10 15 | Total elapsed time, ms: 1.2984105E7 16 | Total Neighborhood size: 8119757 17 | Total number of failed queries: 3 18 | Average Neighborhood size: 1159965 19 | Average query time, ms: 1854872.142857143 20 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/khopResults_graph500_3_rock: -------------------------------------------------------------------------------- 1 | k-hop query with depth = 3 2 | start vertex, neighbor size, query time (in ms) 3 | 3600312, 1519273, 6978893 4 | 2677094, 285633, 41507 5 | 2038005, 1553376, 2917902 6 | 3301167, -1, -1 7 | 704219, 26549, 695 8 | 1779962, 1520027, 7367685 9 | 2681401, -1, -1 10 | 2277366, -1, -1 11 | 1649130, -1, -1 12 | 806220, -1, -1 13 | ===================SUMMARY================================= 14 | Total number of queries: 10 15 | Total elapsed time, ms: 1.7306682E7 16 | Total Neighborhood size: 4904858 17 | Total number of failed queries: 5 18 | Average Neighborhood size: 980971 19 | Average query time, ms: 3461336.4 20 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/khopResults_graph500_6_mm: -------------------------------------------------------------------------------- 1 | k-hop query with depth = 6 2 | start vertex, neighbor size, query time (in ms) 3 | 3600312, -1, -1 4 | 2677094, -1, -1 5 | 2038005, -1, -1 6 | 3301167, -1, -1 7 | 704219, -1, -1 8 | 1779962, -1, -1 9 | 2681401, -1, -1 10 | 2277366, -1, -1 11 | 1649130, -1, -1 12 | 806220, -1, -1 13 | ===================SUMMARY================================= 14 | Total number of queries: 10 15 | Total elapsed time, ms: 0.0 16 | Total Neighborhood size: 0 17 | Total number of failed queries: 10 18 | Average Neighborhood size: -1.0 19 | Average query time, ms: -1.0 20 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/khopResults_graph500_6_rock: -------------------------------------------------------------------------------- 1 | k-hop query with depth = 6 2 | start vertex, neighbor size, query time (in ms) 3 | 3600312, -1, -1 4 | 2677094, -1, -1 5 | 2038005, -1, -1 6 | 3301167, -1, -1 7 | 704219, -1, -1 8 | 1779962, -1, -1 9 | 2681401, -1, -1 10 | 2277366, -1, -1 11 | 1649130, -1, -1 12 | 806220, -1, -1 13 | ===================SUMMARY================================= 14 | Total number of queries: 10 15 | Total elapsed time, ms: 0.0 16 | Total Neighborhood size: 0 17 | Total number of failed queries: 10 18 | Average Neighborhood size: -1.0 19 | Average query time, ms: -1.0 20 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/khopResults_twitter_3_rock: -------------------------------------------------------------------------------- 1 | k-hop query with depth = 3 2 | start vertex, neighbor size, query time (in ms) 3 | 20727483, -1, -1 4 | 50329304, -1, -1 5 | 26199460, -1, -1 6 | 1177521, -1, -1 7 | 27960125, 2022164, 122697 8 | 30440025, -1, -1 9 | 15833920, -1, -1 10 | 15015183, -1, -1 11 | 33153097, -1, -1 12 | 21250581, 20178381, 7680564 13 | ===================SUMMARY================================= 14 | Total number of queries: 10 15 | Total elapsed time, ms: 7803261.0 16 | Total Neighborhood size: 22200545 17 | Total number of failed queries: 8 18 | Average Neighborhood size: 11100272 19 | Average query time, ms: 3901630.5 20 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/khopResults_twitter_6_rock: -------------------------------------------------------------------------------- 1 | k-hop query with depth = 6 2 | start vertex, neighbor size, query time (in ms) 3 | 20727483, -1, -1 4 | 50329304, -1, -1 5 | 26199460, -1, -1 6 | 1177521, -1, -1 7 | 27960125, -1, -1 8 | 30440025, -1, -1 9 | 15833920, -1, -1 10 | 15015183, -1, -1 11 | 33153097, -1, -1 12 | 21250581, -1, -1 13 | ===================SUMMARY================================= 14 | Total number of queries: 10 15 | Total elapsed time, ms: 0.0 16 | Total Neighborhood size: 0 17 | Total number of failed queries: 10 18 | Average Neighborhood size: -1.0 19 | Average query time, ms: -1.0 20 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/pagerankResults_graph500_0_mm: -------------------------------------------------------------------------------- 1 | Test#0, 112.0837984085083 s -------------------------------------------------------------------------------- /benchmark/arangodb/result/pagerankResults_graph500_0_rock: -------------------------------------------------------------------------------- 1 | Test#0, 747.5208852291107 s 2 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/pagerankResults_graph500_1_mm: -------------------------------------------------------------------------------- 1 | Test#1, 123.5143415927887 s -------------------------------------------------------------------------------- /benchmark/arangodb/result/pagerankResults_graph500_1_rock: -------------------------------------------------------------------------------- 1 | Test#1, 514.4492690563202 s 2 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/pagerankResults_graph500_2_mm: -------------------------------------------------------------------------------- 1 | Test#2, 122.69493007659912 s -------------------------------------------------------------------------------- /benchmark/arangodb/result/pagerankResults_graph500_2_rock: -------------------------------------------------------------------------------- 1 | Test#2, 485.8964114189148 s 2 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/pagerankResults_graph500_mm: -------------------------------------------------------------------------------- 1 | Avg time, s: 119.4310233592987 -------------------------------------------------------------------------------- /benchmark/arangodb/result/pagerankResults_graph500_rock: -------------------------------------------------------------------------------- 1 | Avg time, s: 582.6221885681152 2 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/wccResults_graph500_0_mm: -------------------------------------------------------------------------------- 1 | Test#0, 79.976891040802 s -------------------------------------------------------------------------------- /benchmark/arangodb/result/wccResults_graph500_0_rock: -------------------------------------------------------------------------------- 1 | Test#0, 441.0064580440521 s 2 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/wccResults_graph500_1_mm: -------------------------------------------------------------------------------- 1 | Test#1, 91.52712869644165 s -------------------------------------------------------------------------------- /benchmark/arangodb/result/wccResults_graph500_1_rock: -------------------------------------------------------------------------------- 1 | Test#1, 445.0336956977844 s 2 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/wccResults_graph500_2_mm: -------------------------------------------------------------------------------- 1 | Test#2, 91.81424498558044 s -------------------------------------------------------------------------------- /benchmark/arangodb/result/wccResults_graph500_2_rock: -------------------------------------------------------------------------------- 1 | Test#2, 442.63590383529663 s 2 | -------------------------------------------------------------------------------- /benchmark/arangodb/result/wccResults_graph500_mm: -------------------------------------------------------------------------------- 1 | Avg time, s: 87.77275490760803 -------------------------------------------------------------------------------- /benchmark/arangodb/result/wccResults_graph500_rock: -------------------------------------------------------------------------------- 1 | Avg time, s: 442.89201919237775 2 | -------------------------------------------------------------------------------- /benchmark/arangodb/run_khop.sh: -------------------------------------------------------------------------------- 1 | if [ "$#" -lt 1 ] 2 | then 3 | echo "Please provide graph name: graph500 OR twitter" 4 | elif [ "$1" = "graph500" ] 5 | then 6 | echo "Running khop on graph500: k = 1" 7 | nohup java -cp .:\* khop graph500 1 180 8 | 9 | echo "Running khop on graph500: k = 2" 10 | nohup java -cp .:\* khop graph500 2 180 11 | 12 | echo "Running khop on graph500: k = 3" 13 | nohup java -cp .:\* khop graph500 3 9000 14 | 15 | echo "Running khop on graph500: k = 6" 16 | nohup java -cp .:\* khop graph500 6 9000 17 | elif [ "$1" = "twitter" ] 18 | then 19 | echo "Running khop on twitter: k = 1" 20 | nohup java -cp .:\* khop twitter 1 180 21 | 22 | echo "Running khop on twitter: k = 2" 23 | nohup java -cp .:\* khop twitter 2 180 24 | 25 | echo "Running khop on twitter: k = 3" 26 | nohup java -cp .:\* khop twitter 3 9000 27 | 28 | echo "Running khop on twitter: k = 6" 29 | nohup java -cp .:\* khop twitter 6 9000 30 | fi 31 | -------------------------------------------------------------------------------- /benchmark/arangodb/run_pg_wcc.sh: -------------------------------------------------------------------------------- 1 | 2 | if [ "$1" = "graph500" ] && [ "$2" = "pagerank" ] 3 | then 4 | echo "Running PageRank on graph500 ..." 5 | nohup arangosh --server.database "graph500" --server.username "root" --server.password "root" --javascript.execute pg_graph500.js 6 | elif [ "$1" = "twitter" ] && [ "$2" = "pagerank" ] 7 | then 8 | echo "Running PageRank on twitter ..." 9 | nohup arangosh --server.database "twitter" --server.username "root" --server.password "root" --javascript.execute pg_twitter.js 10 | elif [ "$1" = "graph500" ] && [ "$2" = "wcc" ] 11 | then 12 | echo "Running WCC on graph500 ..." 13 | nohup arangosh --server.database "graph500" --server.username "root" --server.password "root" --javascript.execute wcc_graph500.js 14 | elif [ "$1" = "twitter" ] && [ "$2" = "wcc" ] 15 | then 16 | echo "Running WCC on twitter ..." 17 | nohup arangosh --server.database "twitter" --server.username "root" --server.password "root" --javascript.execute wcc_twitter.js 18 | else 19 | echo "Please provide graph name (graph500, twitter) AND algorithm name (pagerank, wcc)" 20 | fi 21 | -------------------------------------------------------------------------------- /benchmark/arangodb/slf4j-simple-1.7.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/arangodb/slf4j-simple-1.7.25.jar -------------------------------------------------------------------------------- /benchmark/arangodb/twitter_rv.net-seed: -------------------------------------------------------------------------------- 1 | 20727483 50329304 26199460 1177521 27960125 30440025 15833920 15015183 33153097 21250581 28548532 42860945 22171728 15254388 44713775 44868770 16350915 33650477 56847735 18056455 32831346 56969867 73483 24981801 25726723 59109778 18381650 8467712 29781057 37886317 39357186 42520611 28471398 1288371 44112249 29088897 15568898 25038085 14075928 96 31835375 22480457 27104736 22687463 27576832 108 35792763 21373148 15234546 14379717 42744015 16927373 16727535 51520097 15078404 14199173 4517721 17323985 18218033 21828142 52674447 15285305 45827167 50826077 54064328 6941 33586608 204 22716284 34386420 36187082 31239408 40316879 10667662 46517052 24523660 14521821 18548221 41496166 27104314 27654423 1685871 23184686 23994973 60312372 8610562 38978212 19740592 18803424 30395784 35908081 21156271 20530182 23378124 29830423 44304625 28830907 31180323 17998925 46822485 42240052 45193938 53758197 20460235 52923055 16129920 15214045 19109927 15917338 27457788 38631864 50808075 19130449 11015592 24777262 14127710 28570061 29941438 15423869 20804997 22667467 26589987 45114047 18087450 961081 14231321 14050138 22742142 36412963 6444062 41608888 15492329 19632867 20194683 22286431 27558050 5120691 48570598 48459607 38407885 23686306 44807976 17129374 1775731 17872794 54491514 18812795 37479006 22281042 26116046 20841950 30244121 14854462 618593 19644074 15735493 43283406 24800750 22872869 20067354 15247448 20912620 20590051 14137268 20143330 18112970 17100967 16732759 54466171 52802702 20373034 32765375 24812106 11894652 51370393 3943871 53469420 14761795 365 46304581 3032431 20977546 21099347 42399917 796766 8909522 16460768 9121432 17919972 56643711 19226267 13221862 41259823 28466425 31806999 759251 59550897 22422221 14662772 15935591 36072333 14669432 14235317 46587124 33497221 41173269 14462907 15922433 22046932 8069572 17073811 19571299 23922282 37975089 71123 13141932 26784273 11172992 23718349 43097584 19829645 25365536 41213114 15683302 19867432 27923061 20536157 14610275 32959253 1045141 39940849 26591593 14293310 26149262 37889798 14803170 16548466 761393 17626181 1418 16609515 32629211 20534044 16797810 30096883 22508419 19124463 42532346 492 16278934 22787048 15163466 22382980 16557588 36880563 43146251 30859015 41716439 6102302 25555552 33370227 43251483 32209489 17910878 23742760 18979962 14230524 24608680 26643090 18659533 39616562 50848585 22359310 18954559 37440908 45251595 45830702 29861887 2884771 25941311 46484827 21407335 14987704 57721125 572 16350844 40926141 54916719 23511857 25515549 18591276 21035409 19923144 16841186 18583722 28335791 2557521 41470461 23006794 16418966 -------------------------------------------------------------------------------- /benchmark/arangodb/wcc_graph500.js: -------------------------------------------------------------------------------- 1 | const pregel = require("@arangodb/pregel") 2 | var graph_module = require("@arangodb/general-graph") 3 | var fs = require("fs"); 4 | 5 | if (graph_module._exists("graph500")){ 6 | graph_module._drop("graph500") 7 | } 8 | 9 | var graph = graph_module._create("graph500"); 10 | 11 | graph._addVertexCollection("vertex"); 12 | var rel = graph_module._relation("edge", ["vertex"], ["vertex"]); 13 | graph._extendEdgeDefinitions(rel); 14 | 15 | var totalTime = 0; 16 | var total = 0; 17 | 18 | for (var i=0; i<3; i++) { 19 | var handle = pregel.start("connectedcomponents", "graph500", {resultField:"wcc"}); 20 | 21 | total++; 22 | 23 | print("computing wcc: Test # " + total); 24 | while (!["done", "canceled"].includes(pregel.status(handle).state)) { 25 | print("waiting to complete... Test # " + total); 26 | require("internal").wait(0.5); 27 | } 28 | 29 | 30 | var status = pregel.status(handle); 31 | print(status); 32 | if (status.state == "done") { 33 | totalTime += status.totalRuntime; 34 | fs.writeFileSync("wccResults_graph500_" + i, "Test#" + i + ", " + status.totalRuntime+" s"); 35 | } 36 | 37 | 38 | } 39 | 40 | 41 | print("SUMMARY WCC for graph500:"); 42 | print("Total time, s: " + totalTime); 43 | print("Total number of tests: " + total); 44 | print("Avg time, s: ", totalTime/total); 45 | fs.writeFileSync("wccResults_graph500", "Avg time, s: " + totalTime/total); 46 | -------------------------------------------------------------------------------- /benchmark/arangodb/wcc_twitter.js: -------------------------------------------------------------------------------- 1 | const pregel = require("@arangodb/pregel") 2 | var graph_module = require("@arangodb/general-graph") 3 | var fs = require("fs"); 4 | 5 | if (graph_module._exists("twitter")){ 6 | graph_module._drop("twitter") 7 | } 8 | 9 | var graph = graph_module._create("twitter"); 10 | 11 | graph._addVertexCollection("vertex"); 12 | var rel = graph_module._relation("edge", ["vertex"], ["vertex"]); 13 | graph._extendEdgeDefinitions(rel); 14 | 15 | var totalTime = 0; 16 | var total = 0; 17 | 18 | 19 | for (var i=0; i<3; i++) { 20 | var handle = pregel.start("connectedcomponents", "twitter", {resultField:"wcc"}); 21 | 22 | total++; 23 | 24 | print("computing wcc: Test # " + total); 25 | while (!["done", "canceled"].includes(pregel.status(handle).state)) { 26 | print("waiting to complete... Test # " + total); 27 | require("internal").wait(0.5); 28 | } 29 | 30 | 31 | var status = pregel.status(handle); 32 | print(status); 33 | if (status.state == "done") { 34 | totalTime += status.totalRuntime; 35 | fs.writeFileSync("wccResults_twitter_" + i, "Test#" + i + ", " + status.totalRuntime+" s"); 36 | } 37 | 38 | 39 | } 40 | 41 | print("SUMMARY WCC for twitter graph"); 42 | print("Total time, s: " + totalTime); 43 | print("Total number of tests: " + total); 44 | print("Avg time, s: ", totalTime/total); 45 | fs.writeFileSync("wccResults_twitter", "Avg time, s: " + totalTime/total); 46 | -------------------------------------------------------------------------------- /benchmark/janusgraph/FileSplitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-now, TigerGraph Inc. 3 | * All rights reserved 4 | * It is provided as it is for benchmark reproducible purpose. 5 | * anyone can use it for benchmark purpose with the 6 | * acknowledgement to TigerGraph. 7 | * Author: Litong Shen litong.shen@tigergraph.com 8 | */ 9 | import java.util.*; 10 | import java.io.PrintWriter; 11 | import java.io.BufferedReader; 12 | import java.io.FileInputStream; 13 | import java.io.IOException; 14 | import java.io.InputStreamReader; 15 | 16 | public class FileSplitor { 17 | public static void main(String[] args){ 18 | String datasetDir = args[0]; 19 | long lineCounter = 0; 20 | try { 21 | BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(datasetDir))); 22 | for (int i = 0; i < 10; i++) { 23 | PrintWriter writer = new PrintWriter("twitter_rv_" + i, "UTF-8"); 24 | String line; 25 | long startTime = System.nanoTime(); 26 | for (long j = 0; j < 160000000; j++) { 27 | if((line = reader.readLine()) == null) { 28 | break; 29 | } 30 | writer.println(line); 31 | lineCounter++; 32 | 33 | } 34 | long endTime = System.nanoTime(); 35 | long duration = (endTime - startTime); 36 | System.out.println("######## loading time ####### " + Long.toString(duration/1000000) + " ms"); 37 | writer.close(); 38 | } 39 | reader.close(); 40 | } catch(IOException ioe) { 41 | ioe.printStackTrace(); 42 | } 43 | System.out.println("---- done ----, total lines: " + lineCounter); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /benchmark/janusgraph/JanusKNeighbor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-now, TigerGraph Inc. 3 | * All rights reserved 4 | * It is provided as it is for benchmark reproducible purpose. 5 | * anyone can use it for benchmark purpose with the 6 | * acknowledgement to TigerGraph. 7 | * Author: Litong Shen litong.shen@tigergraph.com 8 | */ 9 | import java.util.*; 10 | import java.io.BufferedReader; 11 | import java.io.FileInputStream; 12 | import java.io.IOException; 13 | import java.io.InputStreamReader; 14 | 15 | import org.apache.commons.configuration.BaseConfiguration; 16 | import org.apache.commons.configuration.Configuration; 17 | import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.*; 18 | import org.apache.tinkerpop.gremlin.structure.Graph; 19 | 20 | import org.janusgraph.core.schema.*; 21 | import org.janusgraph.util.datastructures.CompactMap; 22 | import org.janusgraph.core.util.*; 23 | import org.janusgraph.core.*; 24 | import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration; 25 | import org.janusgraph.graphdb.database.management.*; 26 | 27 | import java.io.FileWriter; 28 | import java.util.concurrent.Future; 29 | import java.util.concurrent.TimeUnit; 30 | import java.time.Duration; 31 | import java.util.concurrent.Callable; 32 | import java.util.concurrent.TimeoutException; 33 | import java.util.concurrent.ExecutorService; 34 | import java.util.concurrent.Executors; 35 | 36 | public class JanusKNeighbor { 37 | public static JanusGraph janusG; 38 | public static int steps = 1; 39 | public static GraphTraversalSource ts; 40 | 41 | public static void main(String[] args){ 42 | // args 0: property file 43 | String confPath = args[0]; 44 | // args 1: root file 45 | String rootFile = args[1]; 46 | // args 2: traversal depth 47 | steps = Integer.parseInt(args[2]); 48 | // args 3: how many roots to test 49 | int test_count = Integer.parseInt(args[3]); 50 | // args 4: step size for uniform sampling 51 | int sample_step = 1; 52 | if(args.length >= 5){ 53 | sample_step = Integer.parseInt(args[4]); 54 | } 55 | 56 | janusG = JanusGraphFactory.open(confPath); 57 | 58 | try { 59 | // initialize output file 60 | BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(rootFile))); 61 | String resultFileName = "KN-latency-graph500-Traversal-" + steps; 62 | String resultFilePath = "/4ebs/benchmark/code/janusgraph/result/" + resultFileName; 63 | FileWriter writer = new FileWriter(resultFilePath); 64 | writer.write("start vertex,\tneighbor size,\tquery time (in ms)\n"); 65 | writer.flush(); 66 | 67 | String line = reader.readLine(); 68 | reader.close(); 69 | String[] roots = line.split(" "); 70 | 71 | ts = janusG.traversal(); 72 | 73 | // Here set query timeout to 180s 74 | final Duration timeout = Duration.ofSeconds(180); 75 | 76 | long total_neighbor_size = 0; 77 | long total_duration = 0; 78 | int errorQuery = 0; 79 | 80 | for(int i = 0; i < test_count; i += sample_step) { 81 | boolean error = false; 82 | long neighbor_size; 83 | long duration; 84 | String root = roots[i]; 85 | ExecutorService executor = Executors.newSingleThreadExecutor(); 86 | 87 | // handle query timeout 88 | long startTime = System.nanoTime(); 89 | final Future handler = executor.submit(new Callable() { 90 | @Override 91 | public Long call() throws Exception { 92 | return runKNeighbor(root); 93 | } 94 | }); 95 | 96 | try { 97 | neighbor_size = handler.get(timeout.toMillis(), TimeUnit.MILLISECONDS); 98 | } catch (Exception e) { 99 | errorQuery ++; 100 | neighbor_size = 0; 101 | error = true; 102 | handler.cancel(true); 103 | System.out.println("Exception occurred"); 104 | e.printStackTrace(); 105 | } 106 | 107 | // query time calculation 108 | duration = System.nanoTime() - startTime; 109 | executor.shutdownNow(); 110 | 111 | neighbor_size = error? -1:neighbor_size; 112 | duration = error? -1:duration; 113 | total_neighbor_size += error? 0: neighbor_size; 114 | total_duration += error? 0:duration; 115 | 116 | writer.write(root + ",\t" + neighbor_size + ",\t" + duration/1000000.0 + "\n"); 117 | writer.flush(); 118 | System.out.println(root + "," + Long.toString(neighbor_size) + "," + Double.toString((double)duration/1000000.0)); 119 | } 120 | 121 | double avgNeighborSize = test_count == errorQuery ? -1.0 : (double)total_neighbor_size/(double)(test_count - errorQuery); 122 | writer.write("number of start vertex:\t" + test_count + "\n" + "number of query didn't finish correctly:\t" + errorQuery + "\n" 123 | + "number of query didn't finish correctly:\t" + errorQuery + "\n" 124 | + "total query time:\t" + total_duration/1000000.0 + "\n" 125 | + "average neighbor size:\t" + avgNeighborSize + "\n" 126 | + "average query time:\t" + total_duration/1000000.0/(test_count - errorQuery) + "\n"); 127 | 128 | 129 | System.out.println("######## number of start vertex ####### " + test_count); 130 | System.out.println("######## number of timeout queries ####### " + errorQuery); 131 | System.out.println("######## total time ####### " + Double.toString((double)total_duration/1000000.0) + " ms"); 132 | System.out.println("######## average time ####### " + Double.toString((double)total_duration/1000000.0/(double)(test_count - errorQuery)) + " ms"); 133 | System.out.println("######## average kneighbor ####### " + Double.toString(avgNeighborSize)); 134 | 135 | writer.flush(); 136 | writer.close(); 137 | }catch(IOException ioe) { 138 | ioe.printStackTrace(); 139 | } 140 | System.exit(0); 141 | } 142 | 143 | /** this funtion calculate k-hop distinct neighbor size 144 | * return k-hop distinct neighbor size 145 | * @para root the start vertex 146 | */ 147 | private static Long runKNeighbor(String root) { 148 | return ts.V().has("id", root).repeat(__.out("MyEdge")).times(steps).dedup().count().next(); 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /benchmark/janusgraph/PG/JanusPG$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/janusgraph/PG/JanusPG$1.class -------------------------------------------------------------------------------- /benchmark/janusgraph/PG/JanusPageRank$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/janusgraph/PG/JanusPageRank$1.class -------------------------------------------------------------------------------- /benchmark/janusgraph/PG/JanusPageRank.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-now, TigerGraph Inc. 3 | * All rights reserved 4 | * It is provided as it is for benchmark reproducible purpose. 5 | * anyone can use it for benchmark purpose with the 6 | * acknowledgement to TigerGraph. 7 | * Author: Litong Shen litong.shen@tigergraph.com 8 | */ 9 | package PG; 10 | import java.util.*; 11 | import java.io.BufferedReader; 12 | import java.io.FileInputStream; 13 | import java.io.IOException; 14 | import java.io.InputStreamReader; 15 | 16 | import org.apache.commons.configuration.BaseConfiguration; 17 | import org.apache.commons.configuration.Configuration; 18 | import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.*; 19 | import org.apache.tinkerpop.gremlin.structure.Graph; 20 | import org.apache.tinkerpop.gremlin.process.computer.ComputerResult; 21 | 22 | import org.janusgraph.core.schema.*; 23 | import org.janusgraph.util.datastructures.CompactMap; 24 | import org.janusgraph.core.util.*; 25 | import org.janusgraph.core.*; 26 | import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration; 27 | import org.janusgraph.graphdb.database.management.*; 28 | 29 | import java.io.FileWriter; 30 | import java.util.concurrent.Future; 31 | import java.util.concurrent.TimeUnit; 32 | import java.time.Duration; 33 | import java.util.concurrent.Callable; 34 | import java.util.concurrent.TimeoutException; 35 | import java.util.concurrent.ExecutorService; 36 | import java.util.concurrent.Executors; 37 | 38 | 39 | public class JanusPageRank { 40 | public static JanusGraph JanusG; 41 | public static GraphTraversalSource ts; 42 | 43 | public static void main(String[] args){ 44 | // args 0: property file 45 | String confPath = args[0]; 46 | 47 | JanusG = JanusGraphFactory.open(confPath); 48 | try { 49 | // initialize output file 50 | String resultFileName = "PageRank-latency-Graph500" ; 51 | String resultFilePath = "/4ebs/benchmark/code/janusgraph/result/" + resultFileName; 52 | FileWriter writer = new FileWriter(resultFilePath); 53 | writer.write("start pageRank, query time (in ms)\n"); 54 | writer.flush(); 55 | 56 | // set query timeout 57 | final Duration timeout = Duration.ofSeconds(86400); 58 | 59 | ExecutorService executor = Executors.newSingleThreadExecutor(); 60 | 61 | // handle query timeout 62 | long startTime = System.nanoTime(); 63 | final Future handler = executor.submit(new Callable() { 64 | @Override 65 | public String call() throws Exception { 66 | Future result = JanusG.compute().workers(4).program(PG.build().create(JanusG)).submit(); 67 | Graph tmp = result.get().graph(); 68 | 69 | // effective query time calculation 70 | long duration = System.nanoTime() - startTime; 71 | writer.write("============================================\n" 72 | + "total query time:\t" + duration/1000000.0 + "\n" 73 | + "vertex,\tpgValue\n"); 74 | 75 | writer.flush(); 76 | System.out.println("######## total time ####### " + Double.toString((double)duration/1000000.0) + " ms"); 77 | return "complete"; 78 | } 79 | }); 80 | 81 | try { 82 | handler.get(timeout.toMillis(), TimeUnit.MILLISECONDS); 83 | } catch (Exception e) { 84 | handler.cancel(true); 85 | System.out.println("Exception occurred"); 86 | e.printStackTrace(); 87 | } 88 | 89 | executor.shutdownNow(); 90 | writer.close(); 91 | }catch(IOException ioe) { 92 | ioe.printStackTrace(); 93 | } 94 | System.exit(0); 95 | } 96 | 97 | 98 | } 99 | 100 | 101 | -------------------------------------------------------------------------------- /benchmark/janusgraph/PG/PG$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/janusgraph/PG/PG$1.class -------------------------------------------------------------------------------- /benchmark/janusgraph/PG/PG$Builder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/janusgraph/PG/PG$Builder.class -------------------------------------------------------------------------------- /benchmark/janusgraph/PG/PageRankMessageCombiner.java: -------------------------------------------------------------------------------- 1 | package PG; 2 | import org.apache.tinkerpop.gremlin.process.computer.MessageCombiner; 3 | 4 | import java.util.Optional; 5 | 6 | /** 7 | * @author Marko A. Rodriguez (http://markorodriguez.com) 8 | */ 9 | public class PageRankMessageCombiner implements MessageCombiner { 10 | 11 | private static final Optional INSTANCE = Optional.of(new PageRankMessageCombiner()); 12 | 13 | private PageRankMessageCombiner() { 14 | 15 | } 16 | 17 | @Override 18 | public Double combine(final Double messageA, final Double messageB) { 19 | return messageA + messageB; 20 | } 21 | 22 | public static Optional instance() { 23 | return INSTANCE; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /benchmark/janusgraph/WCC-janus.sh: -------------------------------------------------------------------------------- 1 | # this script use to run weakly connected component 2 | # CLASSPATH (need to modify): "$CLASSPATH:path/to/lib/*" 3 | # path/to/config/file (need to modify): e.g. /ebs/install/janusgraph/conf/graph500-janusgraph-cassandra.properties 4 | 5 | export CLASSPATH="$CLASSPATH:/ebs/install/janusgraph/janusgraph-0.2.1-hadoop2/lib/*:." 6 | echo "WCC" 7 | java WCC.JanusWCC path/to/config/file 8 | echo "================" 9 | -------------------------------------------------------------------------------- /benchmark/janusgraph/WCC/JanusWCC$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/janusgraph/WCC/JanusWCC$1.class -------------------------------------------------------------------------------- /benchmark/janusgraph/WCC/JanusWCC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-now, TigerGraph Inc. 3 | * All rights reserved 4 | * It is provided as it is for benchmark reproducible purpose. 5 | * anyone can use it for benchmark purpose with the 6 | * acknowledgement to TigerGraph. 7 | * Author: Litong Shen litong.shen@tigergraph.com 8 | */ 9 | package WCC; 10 | import java.util.*; 11 | import java.io.BufferedReader; 12 | import java.io.FileInputStream; 13 | import java.io.IOException; 14 | import java.io.InputStreamReader; 15 | 16 | import org.apache.commons.configuration.BaseConfiguration; 17 | import org.apache.commons.configuration.Configuration; 18 | import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.*; 19 | import org.apache.tinkerpop.gremlin.structure.Graph; 20 | import org.apache.tinkerpop.gremlin.process.computer.ComputerResult; 21 | 22 | import org.janusgraph.core.schema.*; 23 | import org.janusgraph.util.datastructures.CompactMap; 24 | import org.janusgraph.core.util.*; 25 | import org.janusgraph.core.*; 26 | import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration; 27 | import org.janusgraph.graphdb.database.management.*; 28 | 29 | import java.io.FileWriter; 30 | import java.util.concurrent.Future; 31 | import java.util.concurrent.TimeUnit; 32 | import java.time.Duration; 33 | import java.util.concurrent.Callable; 34 | import java.util.concurrent.TimeoutException; 35 | import java.util.concurrent.ExecutorService; 36 | import java.util.concurrent.Executors; 37 | 38 | public class JanusWCC { 39 | public static JanusGraph JanusG; 40 | 41 | public static void main(String[] args){ 42 | // arg 0: property file 43 | String confPath = args[0]; 44 | 45 | JanusG = JanusGraphFactory.open(confPath); 46 | 47 | //set query timeout 48 | try{ 49 | // initialize output file 50 | String resultFileName = "WCC-latency-twitter" ; 51 | String resultFilePath = "/5ebs/benchmark/code/janusgraph/result/" + resultFileName; 52 | FileWriter writer = new FileWriter(resultFilePath); 53 | writer.write("starting WCC, query time (in ms)\n"); 54 | writer.flush(); 55 | 56 | //set query timeout here 57 | final Duration timeout = Duration.ofSeconds(86400); 58 | long duration = 0; 59 | 60 | ExecutorService executor = Executors.newSingleThreadExecutor(); 61 | long startTime = System.nanoTime(); 62 | final Future handler = executor.submit(new Callable() { 63 | @Override 64 | public String call() throws Exception { 65 | Future result = JanusG.compute().workers(4).program(WCC.build().create(JanusG)).submit(); 66 | 67 | Graph tmp = result.get().graph(); 68 | return "complete"; 69 | } 70 | }); 71 | 72 | try { 73 | handler.get(timeout.toMillis(), TimeUnit.MILLISECONDS); 74 | } catch (Exception e) { 75 | handler.cancel(true); 76 | System.out.println("Exception occurred"); 77 | e.printStackTrace(); 78 | } 79 | 80 | // calculation query time 81 | duration = System.nanoTime() - startTime; 82 | System.out.println("============================================="); 83 | System.out.println("toal time = " + duration/1000000.0 + "ms"); 84 | System.out.println("============================================="); 85 | executor.shutdownNow(); 86 | 87 | writer.write("=============================================\n" 88 | + "toal time = " + duration/1000000.0 + "ms"); 89 | writer.flush(); 90 | writer.close(); 91 | 92 | }catch(Exception ioe) { 93 | ioe.printStackTrace(); 94 | } 95 | System.exit(0); 96 | } 97 | } 98 | 99 | -------------------------------------------------------------------------------- /benchmark/janusgraph/WCC/JanusWeaklyConnectedComponent$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/janusgraph/WCC/JanusWeaklyConnectedComponent$1.class -------------------------------------------------------------------------------- /benchmark/janusgraph/WCC/WCC$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/janusgraph/WCC/WCC$1.class -------------------------------------------------------------------------------- /benchmark/janusgraph/WCC/WCC$Builder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/janusgraph/WCC/WCC$Builder.class -------------------------------------------------------------------------------- /benchmark/janusgraph/WCC/WCCMessageCombiner.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/janusgraph/WCC/WCCMessageCombiner.class -------------------------------------------------------------------------------- /benchmark/janusgraph/WCC/WCCMessageCombiner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-now, TigerGraph Inc. 3 | * All rights reserved 4 | * It is provided as it is for benchmark reproducible purpose. 5 | * anyone can use it for benchmark purpose with the 6 | * acknowledgement to TigerGraph. 7 | * Author: Litong Shen litong.shen@tigergraph.com 8 | */ 9 | package WCC; 10 | import org.apache.tinkerpop.gremlin.process.computer.MessageCombiner; 11 | import java.util.Optional; 12 | 13 | public class WCCMessageCombiner implements MessageCombiner { 14 | private static final Optional INSTANCE = Optional.of(new WCCMessageCombiner()); 15 | private WCCMessageCombiner() { 16 | 17 | } 18 | 19 | @Override 20 | public Long combine(final Long messageA, final Long messageB) { 21 | return messageA < messageB ? messageA : messageB; 22 | } 23 | 24 | public static Optional instance() { 25 | return INSTANCE; 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /benchmark/janusgraph/compile_PG.sh: -------------------------------------------------------------------------------- 1 | # this script use to compile pageRank codes in /PG folder 2 | # LIBPATH (need to modify): "/path/to/lib/" 3 | 4 | export LIBPATH="/ebs/install/janusgraph/janusgraph-0.2.1-hadoop2/lib/" 5 | 6 | echo "compile JanusPG" 7 | javac -cp ${LIBPATH}gremlin-core-3.2.9.jar:${LIBPATH}commons-configuration-1.10.jar:${LIBPATH}janusgraph-core-0.2.1.jar:${LIBPATH}javapoet-1.8.0.jar PG/*.java 8 | -------------------------------------------------------------------------------- /benchmark/janusgraph/compile_WCC.sh: -------------------------------------------------------------------------------- 1 | # this script use to compile java codes in /WCC folder to run weakly connected components 2 | # LIBPATH (need to modify) : "path/to/lib" 3 | 4 | export LIBPATH="/ebs/install/janusgraph/janusgraph-0.2.1-hadoop2/lib/" 5 | echo "compile WCC API and JanusWCC" 6 | javac -cp ${LIBPATH}gremlin-core-3.2.9.jar:${LIBPATH}commons-configuration-1.10.jar:${LIBPATH}janusgraph-core-0.2.1.jar:${LIBPATH}javapoet-1.8.0.jar WCC/*.java 7 | 8 | -------------------------------------------------------------------------------- /benchmark/janusgraph/compile_load_knn.sh: -------------------------------------------------------------------------------- 1 | # This script use to compile java codes for data loading, and K-neighborhoood 2 | # LIBPATH (need to modify): "path/to/lib/" 3 | 4 | export LIBPATH="/ebs/install/janusgraph/janusgraph-0.2.1-hadoop2/lib/" 5 | 6 | echo "compile multiThreadVertexImporter.java" 7 | javac -cp ${LIBPATH}gremlin-core-3.2.9.jar:${LIBPATH}commons-configuration-1.10.jar:${LIBPATH}janusgraph-core-0.2.1.jar:${LIBPATH}javapoet-1.8.0.jar multiThreadVertexImporter.java 8 | 9 | echo "compile multiThreadEdgeImporter.java" 10 | javac -cp ${LIBPATH}gremlin-core-3.2.9.jar:${LIBPATH}commons-configuration-1.10.jar:${LIBPATH}janusgraph-core-0.2.1.jar:${LIBPATH}javapoet-1.8.0.jar multiThreadEdgeImporter.java 11 | 12 | echo "compile singleThreadVertexImporter.java" 13 | javac -cp ${LIBPATH}gremlin-core-3.2.9.jar:${LIBPATH}commons-configuration-1.10.jar:${LIBPATH}janusgraph-core-0.2.1.jar:${LIBPATH}javapoet-1.8.0.jar singleThreadVertexImporter.java 14 | 15 | echo "compile singleThreadEdgeImporter.java" 16 | javac -cp ${LIBPATH}gremlin-core-3.2.9.jar:${LIBPATH}commons-configuration-1.10.jar:${LIBPATH}janusgraph-core-0.2.1.jar:${LIBPATH}javapoet-1.8.0.jar singleThreadEdgeImporter.java 17 | 18 | echo "compile singleThreadGraph500Importer.java" 19 | javac -cp ${LIBPATH}gremlin-core-3.2.9.jar:${LIBPATH}commons-configuration-1.10.jar:${LIBPATH}janusgraph-core-0.2.1.jar:${LIBPATH}javapoet-1.8.0.jar singleThreadGraph500Importer.java 20 | 21 | echo "compile JanusKNeighbor.java" 22 | javac -cp ${LIBPATH}gremlin-core-3.2.9.jar:${LIBPATH}commons-configuration-1.10.jar:${LIBPATH}janusgraph-core-0.2.1.jar:${LIBPATH}javapoet-1.8.0.jar JanusKNeighbor.java 23 | 24 | -------------------------------------------------------------------------------- /benchmark/janusgraph/dedup.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.util.*; 3 | import java.io.FileWriter; 4 | import java.io.File; 5 | import java.io.FileReader; 6 | import java.io.IOException; 7 | 8 | public class dedup{ 9 | public static void main(String[] args){ 10 | try{ 11 | File file = new File("/Ebs/raw/graph500-22/graph500-22"); 12 | FileReader fileReader = new FileReader(file); 13 | BufferedReader bufferedReader = new BufferedReader(fileReader); 14 | StringBuffer stringBuffer = new StringBuffer(); 15 | String line; 16 | 17 | String resultPath = "/Ebs/raw/graph500-22/graph500-22-dedup"; 18 | FileWriter writer = new FileWriter(resultPath); 19 | 20 | HashSet vertex = new HashSet(); 21 | 22 | while((line = bufferedReader.readLine()) != null){ 23 | if(!vertex.contains(line)){ 24 | writer.write(line + '\n'); 25 | vertex.add(line); 26 | } 27 | 28 | } 29 | writer.flush(); 30 | writer.close(); 31 | bufferedReader.close(); 32 | 33 | }catch(IOException e){ 34 | e.printStackTrace(); 35 | } 36 | 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /benchmark/janusgraph/edge_graph500_multi_threads.sh: -------------------------------------------------------------------------------- 1 | # this script use to retrieve vertex hashmap then load graph500 edge file 2 | # CLASSPATH (need to modify): e.g. "$CLASSPATH:/ebs/install/janusgraph/janusgraph-0.2.1-hadoop2/lib/*" 3 | # path/to/graph500/edge/file (need to modify): e.g. /ebs/raw/graph500-22/graph500-22 4 | # path/to/conf/file (need to modify): e.g. /ebs/install/janusgraph/conf/graph500-janusgraph-cassandra.properties 5 | # path/to/graph500/hashmap/file (need to modify): e.g./ebs/raw/graph500/hashMap 6 | 7 | export CLASSPATH="$CLASSPATH:/path/to/lib/*" 8 | echo "load graph500 edge file" 9 | java -Xmx96g multiThreadEdgeImporter path/to/graph500/edge/file path/to/conf/file 4000 path/to/graph500/hashmap/file 10 | -------------------------------------------------------------------------------- /benchmark/janusgraph/edge_loader_twitter.sh: -------------------------------------------------------------------------------- 1 | # this script use to retrieve vertex hashmap then load partitioned twitter edge files one by one 2 | # CLASSPATH (need to modify): e.g. "$CLASSPATH:/ebs/install/janusgraph/janusgraph-0.2.1-hadoop2/lib/*" 3 | # edgeImpoter/class (need to modify): e.g multiThreadEdgeImporter 4 | # path/to/twtter/splited/data (need to modify): e.g. /ebs/raw/twitter_rv/splited/twitter_rv_0 5 | # path/to/conf/file (need to modify): e.g. /ebs/install/janusgraph/conf/twitter_generate_hashmap.properties 6 | # path/to/twiiter/hashmap/file (need to modify): e.g./ebs/raw/twitter_rv/twitter-hashMap 7 | 8 | export CLASSPATH="$CLASSPATH:/path/to/lib/*" 9 | echo "file: twitter_rv_0" 10 | java -Xmx96g edgeImpoter/class path/to/twtter/splited/data path/to/conf/file 4000 path/to/twiiter/hashmap/file 11 | echo "file: twitter_rv_1" 12 | java -Xmx96g edgeImpoter/class path/to/twtter/splited/data path/to/conf/file 4000 path/to/twiiter/hashmap/file 13 | echo "file: twitter_rv_2" 14 | java -Xmx96g edgeImpoter/class path/to/twtter/splited/data path/to/conf/file 4000 path/to/twiiter/hashmap/file 15 | echo "file: twitter_rv_3" 16 | java -Xmx96g edgeImpoter/class path/to/twtter/splited/data path/to/conf/file 4000 path/to/twiiter/hashmap/file 17 | echo "file: twitter_rv_4" 18 | java -Xmx96g edgeImpoter/class path/to/twtter/splited/data path/to/conf/file 4000 path/to/twiiter/hashmap/file 19 | echo "file: twitter_rv_5" 20 | java -Xmx96g edgeImpoter/class path/to/twtter/splited/data path/to/conf/file 4000 path/to/twiiter/hashmap/file 21 | echo "file: twitter_rv_6" 22 | java -Xmx96g edgeImpoter/class path/to/twtter/splited/data path/to/conf/file 4000 path/to/twiiter/hashmap/file 23 | echo "file: twitter_rv_7" 24 | java -Xmx96g edgeImpoter/class path/to/twtter/splited/data path/to/conf/file 4000 path/to/twiiter/hashmap/file 25 | echo "file: twitter_rv_8" 26 | java -Xmx96g edgeImpoter/class path/to/twtter/splited/data path/to/conf/file 4000 path/to/twiiter/hashmap/file 27 | echo "file: twitter_rv_9" 28 | java -Xmx96g edgeImpoter/class path/to/twtter/splited/data path/to/conf/file 4000 path/to/twiiter/hashmap/file 29 | -------------------------------------------------------------------------------- /benchmark/janusgraph/graph500-22-seed: -------------------------------------------------------------------------------- 1 | 3600312 2677094 2038005 3301167 704219 1779962 2681401 2277366 1649130 806220 3783689 3979771 2878950 1316789 4099483 2654216 3520283 320529 460890 2861567 1676721 3582851 2025534 1897682 3042164 683461 484783 2964318 825304 2303395 3029190 2119218 341236 3921645 3350720 1382338 2497566 2293317 1365818 3108349 1039487 656628 326459 3486463 1513849 3120768 3254104 2859677 4100533 1214662 2844418 3228461 2971789 838862 3242202 231946 103480 745855 2202837 121973 2944986 3916778 1237877 2404335 3903782 3753107 2638320 3532534 3026267 149529 2522099 1565761 1345848 1059426 2994540 1629629 1481421 337894 2706001 342515 2301230 3455722 4103891 2560844 316796 3853684 2803721 2782143 4168065 1297201 2982970 1089600 3589606 1978189 514482 773765 1929789 2499474 1367644 3052548 2020748 1934532 2595851 1265635 2678981 3484689 2778764 323958 1972929 2529296 2638682 2836761 3489646 2304697 3006908 3976118 432800 3408347 3184190 2478197 3990575 3097880 259436 479595 2054949 1014166 2398658 3499821 289302 2689848 603652 2764479 3458769 2372488 3826201 610619 1502380 1417031 1291296 1699680 1816799 2952048 3747093 996609 1906969 712790 1973404 2874441 4072076 534367 2419131 3145715 1172458 2547240 579284 3952328 3217974 928922 2975442 3686619 143324 2262470 2844253 3960743 95176 2661831 289798 498881 459455 3778765 2575099 2321106 898887 1630163 3268706 25081 3747551 2048028 1377545 2178454 3666746 1692598 1809240 1461949 3878592 96570 4095479 2539031 364055 3514283 3843398 3556803 2592596 168 2336570 327991 2445956 1140337 2663510 2514997 1933620 1076164 3734798 99836 2404509 3102298 2158818 3088473 3861233 1453810 1952126 968226 594138 1059034 408333 3246311 587844 1602562 2546319 2861944 1360827 1915610 957424 1427107 433135 3353932 140407 1989222 1392471 1290284 2144691 1299024 764990 302910 4192735 3181076 1535127 263980 1571976 2271738 492328 3976408 1621372 3024237 3229179 2167063 102878 4085765 2370758 2987431 2633916 1177859 1581601 18147 697579 3491436 699069 1608362 2570730 3929663 1304943 3733946 2216412 3013035 261001 32290 113329 1509856 2190260 3103760 3687843 1245035 3341532 857395 3942814 3982809 2807038 3291942 1840809 760204 3108890 1416278 3725922 2189358 2810970 655805 63077 3708992 2622204 1647516 1274701 2238470 83658 3800740 3659055 740181 318596 1353213 3058396 3497001 -------------------------------------------------------------------------------- /benchmark/janusgraph/graph500-janusgraph-cassandra.properties: -------------------------------------------------------------------------------- 1 | # JanusGraph configuration sample: Cassandra over a socket 2 | # 3 | # This file connects to a Cassandra daemon running on localhost via 4 | # Thrift. Cassandra must already be started before starting JanusGraph 5 | # with this file. 6 | 7 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 8 | 9 | # The primary persistence provider used by JanusGraph. This is required. 10 | # It should be set one of JanusGraph's built-in shorthand names for its 11 | # standard storage backends (shorthands: berkeleyje, cassandrathrift, 12 | # cassandra, astyanax, embeddedcassandra, hbase, inmemory) or to the full 13 | # package and classname of a custom/third-party StoreManager 14 | # implementation. 15 | # 16 | # Default: (no default value) 17 | # Data Type: String 18 | # Mutability: LOCAL 19 | storage.backend=cassandrathrift 20 | #Jianlong#storage.backend=embeddedcassandra 21 | storage.batch-loading=true 22 | storage.cassandra.keyspace=graph500 23 | 24 | storage.cassandra.frame-size-mb=128 25 | # The hostname or comma-separated list of hostnames of storage backend 26 | # servers. This is only applicable to some storage backends, such as 27 | # cassandra and hbase. 28 | # 29 | # Default: 127.0.0.1 30 | # Data Type: class java.lang.String[] 31 | # Mutability: LOCAL 32 | storage.hostname=127.0.0.1 33 | 34 | # Whether to enable JanusGraph's database-level cache, which is shared 35 | # across all transactions. Enabling this option speeds up traversals by 36 | # holding hot graph elements in memory, but also increases the likelihood 37 | # of reading stale data. Disabling it forces each transaction to 38 | # independently fetch graph elements from storage before reading/writing 39 | # them. 40 | # 41 | # Default: false 42 | # Data Type: Boolean 43 | # Mutability: MASKABLE 44 | #cache.db-cache = true 45 | 46 | # How long, in milliseconds, database-level cache will keep entries after 47 | # flushing them. This option is only useful on distributed storage 48 | # backends that are capable of acknowledging writes without necessarily 49 | # making them immediately visible. 50 | # 51 | # Default: 50 52 | # Data Type: Integer 53 | # Mutability: GLOBAL_OFFLINE 54 | # 55 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in 56 | # JanusGraph's storage backend. After starting the database for the first 57 | # time, this file's copy of this setting is ignored. Use JanusGraph's 58 | # Management System to read or modify this value after bootstrapping. 59 | #cache.db-cache-clean-wait = 20 60 | 61 | # Default expiration time, in milliseconds, for entries in the 62 | # database-level cache. Entries are evicted when they reach this age even 63 | # if the cache has room to spare. Set to 0 to disable expiration (cache 64 | # entries live forever or until memory pressure triggers eviction when set 65 | # to 0). 66 | # 67 | # Default: 10000 68 | # Data Type: Long 69 | # Mutability: GLOBAL_OFFLINE 70 | # 71 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in 72 | # JanusGraph's storage backend. After starting the database for the first 73 | # time, this file's copy of this setting is ignored. Use JanusGraph's 74 | # Management System to read or modify this value after bootstrapping. 75 | #cache.db-cache-time = 180000 76 | 77 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 78 | # interpreted as a percentage of VM heap, while larger values are 79 | # interpreted as an absolute size in bytes. 80 | # 81 | # Default: 0.3 82 | # Data Type: Double 83 | # Mutability: MASKABLE 84 | #cache.db-cache-size = 0.5 85 | 86 | ids.block-size = 48000000 87 | storage.transactions = false 88 | storage.write-time = 1000000 ms 89 | storage.cassandra.write-consistency-level = ANY 90 | storage.cassandra.read-consistency-level = ONE 91 | 92 | -------------------------------------------------------------------------------- /benchmark/janusgraph/knn-janus.sh: -------------------------------------------------------------------------------- 1 | # this sript use to run k-hops query 2 | # CLASSPATH (need to modify): "$CLASSPATH:path/to/lib/*" 3 | # path/to/config/file (need to modify): e.g. /ebs/install/janusgraph/conf/graph500-janusgraph-cassandra.properties 4 | # path/to/random/seed (need to modify): e.g. /ebs/benchmark/code/janusgraph/graph500-22-seed 5 | # traversal_depth (need to modify): 1 for 1 step, 2 for 2 steps .. 6 | # number_of_seed_to_test (need to modify): number of random seed you want to test, up to 300. 7 | 8 | export CLASSPATH="$CLASSPATH:/ebs/install/janusgraph/janusgraph-0.2.1-hadoop2/lib/*" 9 | echo "knn" 10 | java JanusKNeighbor path/to/config/file path/to/random/seed traversal_depth number_of_seed_to_test 11 | echo "=================" 12 | -------------------------------------------------------------------------------- /benchmark/janusgraph/load_graph500_single_thread.sh: -------------------------------------------------------------------------------- 1 | # this script use to load graph500 data 2 | # CLASSPATH (need to modify): e.g. "$CLASSPATH:/ebs/install/janusgraph/janusgraph-0.2.1-hadoop2/lib/*" 3 | # path/to/graph500/rawData (need to modify): e.g. /ebs/raw/graph500-22/graph500-22 4 | # path/to/configuration/file (need to modify): e.g. /ebs/install/janusgraph/conf/graph500-janusgraph-cassandra.properties 5 | 6 | export CLASSPATH="$CLASSPATH:path/to/lib/*" 7 | java -Xmx96g singleThreadGraph500Importer path/to/graph500/rawData path/to/configuration/file 4000 8 | 9 | -------------------------------------------------------------------------------- /benchmark/janusgraph/multiThreadEdgeImporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-now, TigerGraph Inc. 3 | * All rights reserved 4 | * It is provided as it is for benchmark reproducible purpose. 5 | * anyone can use it for benchmark purpose with the 6 | * acknowledgement to TigerGraph. 7 | * Author: Litong Shen litong.shen@tigergraph.com 8 | */ 9 | import java.util.*; 10 | import java.util.concurrent.ExecutorService; 11 | import java.util.concurrent.Executors; 12 | import java.util.concurrent.TimeUnit; 13 | 14 | import java.io.BufferedReader; 15 | import java.io.FileInputStream; 16 | import java.io.IOException; 17 | import java.io.InputStreamReader; 18 | import java.io.FileWriter; 19 | 20 | import org.apache.commons.configuration.BaseConfiguration; 21 | import org.apache.commons.configuration.Configuration; 22 | 23 | import org.janusgraph.core.schema.*; 24 | import org.janusgraph.util.datastructures.CompactMap; 25 | import org.janusgraph.core.util.*; 26 | import org.janusgraph.core.*; 27 | import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration; 28 | import org.janusgraph.graphdb.database.management.*; 29 | import org.janusgraph.graphdb.vertices.AbstractVertex; 30 | import org.janusgraph.graphdb.internal.ElementLifeCycle; 31 | import org.janusgraph.graphdb.vertices.StandardVertex; 32 | import org.janusgraph.graphdb.transaction.StandardJanusGraphTx; 33 | 34 | public class multiThreadEdgeImporter { 35 | public static JanusGraph JanusG; 36 | public static int commitBatch = 4000; 37 | 38 | private static List source = new ArrayList<>(commitBatch); 39 | private static List target = new ArrayList<>(commitBatch); 40 | private static List fileBuffer = new ArrayList<>(); 41 | 42 | private static ExecutorService pool = Executors.newFixedThreadPool(8); 43 | 44 | private static HashMap idset1= new HashMap(); 45 | 46 | public static void main(String[] args){ 47 | String datasetDir = args[0]; 48 | String confPath = args[1]; 49 | commitBatch = Integer.parseInt(args[2]); 50 | String hashmapDir = args[3]; 51 | 52 | BaseConfiguration config = new BaseConfiguration(); 53 | 54 | JanusG = JanusGraphFactory.open(confPath); 55 | 56 | try { 57 | for(int i =0; i<8; i++) { 58 | // hashmap reader 59 | BufferedReader hashmapReader = new BufferedReader(new InputStreamReader(new FileInputStream(hashmapDir + String.valueOf(i)))); 60 | String line2; 61 | 62 | //create vertex hashmap without new vertex 63 | while((line2 = hashmapReader.readLine()) != null) { 64 | String[] kvPairs = line2.split("\t"); 65 | idset1.put(Long.parseLong(kvPairs[0]),Long.parseLong(kvPairs[1])); 66 | } 67 | hashmapReader.close(); 68 | } 69 | System.out.println("finished construct vertex hashmap"); 70 | 71 | //add edge 72 | 73 | long lineCounter = 0; 74 | long startTime = System.nanoTime(); 75 | 76 | // edge reader 77 | BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(datasetDir))); 78 | readFile2Buffer(reader); 79 | reader.close(); 80 | 81 | // add edge with idset1(hashmap without create vertex) 82 | 83 | for(String line : fileBuffer) { 84 | try { 85 | String[] parts = line.split("\t"); 86 | 87 | Long src = Long.parseLong(parts[0]); 88 | Long tgt = Long.parseLong(parts[1]); 89 | source.add(src); 90 | target.add(tgt); 91 | 92 | lineCounter ++; 93 | if(lineCounter % commitBatch == 0) { 94 | System.out.println("---- commit ----: " + Long.toString(lineCounter / commitBatch)); 95 | batchCommit(); 96 | } 97 | } catch (Exception e) { 98 | e.printStackTrace(); 99 | } 100 | } 101 | batchCommit(); 102 | pool.shutdown(); 103 | try { 104 | pool.awaitTermination(1440, TimeUnit.MINUTES); 105 | } catch (InterruptedException e) { 106 | e.printStackTrace(); 107 | } 108 | 109 | JanusG.tx().commit(); 110 | 111 | 112 | long endTime = System.nanoTime(); 113 | long duration = (endTime - startTime); 114 | System.out.println("######## loading time ####### " + Long.toString(duration/1000000) + " ms"); 115 | } 116 | catch(IOException ioe) { 117 | ioe.printStackTrace(); 118 | } 119 | System.out.println("---- done ----"); 120 | System.exit(0); 121 | } 122 | 123 | 124 | /** this function read data from disk to memory 125 | * @para reader buffering characters 126 | */ 127 | private static void readFile2Buffer(BufferedReader reader) { 128 | try { 129 | String line; 130 | while((line = reader.readLine()) != null) { 131 | fileBuffer.add(line); 132 | } 133 | } catch (IOException ioe) { 134 | ioe.printStackTrace(); 135 | } 136 | } 137 | 138 | /** this function use multi threads to batch load data 139 | */ 140 | private static void batchCommit() { 141 | List src = source; 142 | source = new ArrayList<>(commitBatch); 143 | List tgt = target; 144 | target = new ArrayList<>(commitBatch); 145 | 146 | pool.submit(() -> { 147 | Long srcInternalId, dstInternalId; 148 | JanusGraphVertex srcVertex, dstVertex; 149 | JanusGraphTransaction tx = JanusG.newTransaction(); 150 | for (int i = 0; i < src.size(); i++) { 151 | srcInternalId = idset1.get(src.get(i)); 152 | dstInternalId = idset1.get(tgt.get(i)); 153 | 154 | srcVertex = tx.getVertex(srcInternalId); 155 | dstVertex = tx.getVertex(dstInternalId); 156 | JanusGraphEdge edge = srcVertex.addEdge("MyEdge", dstVertex); 157 | } 158 | tx.commit(); 159 | }); 160 | } 161 | 162 | } 163 | -------------------------------------------------------------------------------- /benchmark/janusgraph/multiThreadVertexImporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-now, TigerGraph Inc. 3 | * All rights reserved 4 | * It is provided as it is for benchmark reproducible purpose. 5 | * anyone can use it for benchmark purpose with the 6 | * acknowledgement to TigerGraph. 7 | * Author: Litong Shen litong.shen@tigergraph.com 8 | */ 9 | import java.util.*; 10 | import java.util.concurrent.ExecutorService; 11 | import java.util.concurrent.Executors; 12 | import java.util.concurrent.TimeUnit; 13 | import java.util.concurrent.ThreadFactory; 14 | 15 | import java.io.BufferedReader; 16 | import java.io.FileInputStream; 17 | import java.io.IOException; 18 | import java.io.InputStreamReader; 19 | import java.io.FileWriter; 20 | 21 | import org.apache.commons.configuration.BaseConfiguration; 22 | import org.apache.commons.configuration.Configuration; 23 | 24 | import org.janusgraph.core.schema.*; 25 | import org.janusgraph.util.datastructures.CompactMap; 26 | import org.janusgraph.core.util.*; 27 | import org.janusgraph.core.*; 28 | import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration; 29 | import org.janusgraph.graphdb.database.management.*; 30 | import org.janusgraph.graphdb.vertices.AbstractVertex; 31 | import org.janusgraph.graphdb.internal.ElementLifeCycle; 32 | import org.janusgraph.graphdb.vertices.StandardVertex; 33 | import org.janusgraph.graphdb.transaction.StandardJanusGraphTx; 34 | 35 | public class multiThreadVertexImporter { 36 | public static JanusGraph JanusG; 37 | public static int commitBatch = 1; 38 | 39 | private static Set allVertices = new HashSet<>(); 40 | private static Set vertices = new HashSet<>(); 41 | 42 | private static List fileBuffer = new ArrayList<>(); 43 | 44 | private static ExecutorService pool = Executors.newFixedThreadPool(8, new MyThreadFactory()); 45 | 46 | public static void main(String[] args){ 47 | String datasetDir = args[0]; 48 | String confPath = args[1]; 49 | commitBatch = Integer.parseInt(args[2]); 50 | 51 | BaseConfiguration config = new BaseConfiguration(); 52 | 53 | JanusG = JanusGraphFactory.open(confPath); 54 | JanusG.close(); 55 | JanusGraphCleanup.clear(JanusG); 56 | JanusG = JanusGraphFactory.open(confPath); 57 | 58 | ManagementSystem mgmt = (ManagementSystem) JanusG.openManagement(); 59 | mgmt.makeEdgeLabel("MyEdge").make(); 60 | mgmt.makeVertexLabel("MyNode").make(); 61 | PropertyKey id_key = mgmt.makePropertyKey("id").dataType(String.class).make(); 62 | PropertyKey pageRank_key = mgmt.makePropertyKey("gremlin.pageRankVertexProgram.pageRank").dataType(Double.class).make(); 63 | PropertyKey edgeCount_key = mgmt.makePropertyKey("gremlin.pageRankVertexProgram.edgeCount").dataType(Long.class).make(); 64 | PropertyKey groupId_key = mgmt.makePropertyKey("WCC.groupId").dataType(Long.class).make(); 65 | mgmt.buildIndex("byId", JanusGraphVertex.class).addKey(id_key).unique().buildCompositeIndex(); 66 | mgmt.commit(); 67 | try{ 68 | mgmt.awaitGraphIndexStatus(JanusG, "byId").call(); 69 | } 70 | catch(Exception ex) { 71 | ex.printStackTrace(); 72 | System.exit(-1); 73 | } 74 | 75 | try { 76 | BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(datasetDir))); 77 | long lineCounter = 0; 78 | long startTime = System.nanoTime(); 79 | 80 | readFile2Buffer(reader); 81 | 82 | for(String line : fileBuffer) { 83 | try { 84 | Long node = Long.parseLong(line); 85 | allVertices.add(node); 86 | vertices.add(node); 87 | lineCounter++; 88 | if(lineCounter % commitBatch == 0){ 89 | batchCommit(); 90 | System.out.println("---- commit ----: " + Long.toString(lineCounter / commitBatch)); 91 | } 92 | 93 | } catch (Exception e) { 94 | e.printStackTrace(); 95 | } 96 | } 97 | 98 | batchCommit(); 99 | pool.shutdown(); 100 | try { 101 | pool.awaitTermination(1440, TimeUnit.MINUTES); 102 | } catch (InterruptedException e) { 103 | e.printStackTrace(); 104 | } 105 | 106 | long endTime = System.nanoTime(); 107 | long duration = (endTime - startTime); 108 | System.out.println("######## time to generateVertexHashMap and load vertex file ####### " + Long.toString(duration/1000000) + " ms"); 109 | } catch (Exception e) { 110 | e.printStackTrace(); 111 | } 112 | 113 | System.out.println("---- done ----, total V: " + Integer.toString(allVertices.size())); 114 | System.exit(0); 115 | } 116 | 117 | /** this function read file from disk to memory 118 | * @para reader buffering characters 119 | */ 120 | private static void readFile2Buffer(BufferedReader reader) { 121 | try { 122 | String line; 123 | while((line = reader.readLine()) != null) { 124 | fileBuffer.add(line); 125 | } 126 | } catch (IOException ioe) { 127 | ioe.printStackTrace(); 128 | 129 | } 130 | } 131 | 132 | /** this function use multi threads to batch load data and 133 | * write hashmap(vertexExternalId: vertexInternalId) to disk 134 | */ 135 | private static void batchCommit() { 136 | Set newVertices = vertices; 137 | vertices = new HashSet<>(); 138 | 139 | pool.submit(() -> { 140 | try { 141 | String threadId = Thread.currentThread().getName(); 142 | String hashMapName = "hashMap" + threadId; 143 | String hashMapPath = "/Ebs/benchmark/code/janusgraph/data/" + hashMapName; 144 | 145 | FileWriter writer = new FileWriter(hashMapPath, true); 146 | 147 | JanusGraphTransaction tx = JanusG.newTransaction(); 148 | for (Long n : newVertices) { 149 | JanusGraphVertex srcVertex = tx.addVertex("MyNode"); 150 | srcVertex.property("id", n); 151 | srcVertex.property("gremlin.pageRankVertexProgram.pageRank", 1.0); 152 | srcVertex.property("gremlin.pageRankVertexProgram.edgeCount", 0); 153 | srcVertex.property("WCC.groupId", n); 154 | try { 155 | writer.write(n + "\t" + srcVertex.id() + "\n"); 156 | } catch (Exception e) { 157 | e.printStackTrace(); 158 | } 159 | } 160 | writer.flush(); 161 | writer.close(); 162 | tx.commit(); 163 | } catch (Exception e) { 164 | e.printStackTrace(); 165 | } 166 | }); 167 | } 168 | 169 | /** this class define name for threads 170 | */ 171 | private static class MyThreadFactory implements ThreadFactory { 172 | private int counter = 0; 173 | public Thread newThread(Runnable r) { 174 | return new Thread(r, "" + counter++); 175 | } 176 | } 177 | 178 | } 179 | -------------------------------------------------------------------------------- /benchmark/janusgraph/pg-janus.sh: -------------------------------------------------------------------------------- 1 | # this script use to run PageRank 2 | # CLASSPATH (need to modify): e.g. "$CLASSPATH:/ebs/install/janusgraph/janusgraph-0.2.1-hadoop2/lib/*" 3 | # path/to/conf/file (need to modify): e.g. /ebs/install/janusgraph/conf/graph500-janusgraph-cassandra.properties 4 | # path/to/unique/id/file (need to modify): e.g. /ebs/raw/graph500-22/graph500_janusgraph_ids 5 | 6 | export CLASSPATH="$CLASSPATH:/path/to/lib/*:." 7 | echo "PageRank" 8 | java PG.JanusPageRank path/to/conf/file path/to/unique/id/file 9 | echo "====================" 10 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/KN-latency-graph500-Traversal-3: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 3600312, 1519273, 1526227.963471 3 | 2677094, 285633, 15801.026958 4 | 2038005, 1553376, 682966.954146 5 | 3301167, -1, -1.0E-6 6 | 704219, 26549, 345.691885 7 | 1779962, 1520027, 1436087.998226 8 | 2681401, -1, -1.0E-6 9 | 2277366, 1682414, 1997290.598709 10 | 1649130, 2099589, 6197278.486215 11 | 806220, 1532485, 2917714.878228 12 | number of start vertex: 10 13 | number of query didn't finish correctly: 2 14 | total neighbor size: 10219346 15 | total query time: 1.4773713597838E7 16 | average neighbor size: 1277418 17 | average query time: 1846714.19972975 18 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/KN-latency-graph500-Traversal-6: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 3600312, -1, -1.0E-6 3 | 2677094, -1, -1.0E-6 4 | 2038005, -1, -1.0E-6 5 | 3301167, -1, -1.0E-6 6 | 704219, -1, -1.0E-6 7 | 1779962, -1, -1.0E-6 8 | 2681401, -1, -1.0E-6 9 | 2277366, -1, -1.0E-6 10 | 1649130, -1, -1.0E-6 11 | 806220, -1, -1.0E-6 12 | number of start vertex: 10 13 | number of query didn't finish correctly: 10 14 | total neighbor size: 0 15 | total query time: 0.0 16 | average neighbor size: -1.0 17 | average query time: NaN 18 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/KN-latency-twitter-Traversal-3: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 20727483, 18098900, 4780361.353026 3 | 50329304, 20303955, 8911491.278898 4 | 26199460, -1, -1.0E-6 5 | 1177521, -1, -1.0E-6 6 | 27960125, 2022164, 30939.370128 7 | 30440025, -1, -1.0E-6 8 | 15833920, -1, -1.0E-6 9 | 15015183, -1, -1.0E-6 10 | 33153097, 24245033, 4298591.593943 11 | 21250581, 20178381, 3598493.209439 12 | number of start vertex: 10 13 | number of query didn't finish correctly: 5 14 | total neighbor size: 84848433 15 | total query time: 2.1619876805434E7 16 | average neighbor size: 16969686 17 | average query time: 4323975.3610868 18 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/KN-latency-twitter-Traversal-6: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 20727483, -1, -1.0E-6 3 | 50329304, -1, -1.0E-6 4 | 26199460, -1, -1.0E-6 5 | 1177521, -1, -1.0E-6 6 | 27960125, -1, -1.0E-6 7 | 30440025, -1, -1.0E-6 8 | 15833920, -1, -1.0E-6 9 | 15015183, -1, -1.0E-6 10 | 33153097, -1, -1.0E-6 11 | 21250581, -1, -1.0E-6 12 | number of start vertex: 10 13 | number of query didn't finish correctly: 10 14 | total neighbor size: 0 15 | total query time: 0.0 16 | average neighbor size: -1.0 17 | average query time: NaN 18 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/PageRank-latency-Graph500-16threads: -------------------------------------------------------------------------------- 1 | start pageRank, query time (in ms) 2 | ============================================ 3 | total query time: 2773073.325639 4 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/PageRank-latency-Graph500-1thread: -------------------------------------------------------------------------------- 1 | start pageRank, query time (in ms) 2 | ============================================ 3 | total query time: 9464747.9419 4 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/PageRank-latency-Graph500-4threads-1: -------------------------------------------------------------------------------- 1 | start pageRank, query time (in ms) 2 | ============================================ 3 | total query time: 2723254.369559 4 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/PageRank-latency-Graph500-4threads-2: -------------------------------------------------------------------------------- 1 | start pageRank, query time (in ms) 2 | ============================================ 3 | total query time: 2549382.249053 4 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/PageRank-latency-Graph500-4threads-3: -------------------------------------------------------------------------------- 1 | start pageRank, query time (in ms) 2 | ============================================ 3 | total query time: 2559544.092217 4 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/PageRank-latency-Graph500-8threads: -------------------------------------------------------------------------------- 1 | start pageRank, query time (in ms) 2 | ============================================ 3 | total query time: 2814621.538203 4 | -------------------------------------------------------------------------------- /benchmark/janusgraph/result/WCC-latency-Graph500-1: -------------------------------------------------------------------------------- 1 | starting WCC, query time (in ms) 2 | ============================================= 3 | toal time = 2229597.92728ms -------------------------------------------------------------------------------- /benchmark/janusgraph/result/WCC-latency-Graph500-2: -------------------------------------------------------------------------------- 1 | starting WCC, query time (in ms) 2 | ============================================= 3 | toal time = 2223878.71393ms -------------------------------------------------------------------------------- /benchmark/janusgraph/result/WCC-latency-Graph500-3: -------------------------------------------------------------------------------- 1 | starting WCC, query time (in ms) 2 | ============================================= 3 | toal time = 2286146.23324ms -------------------------------------------------------------------------------- /benchmark/janusgraph/singleThreadEdgeImporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-now, TigerGraph Inc. 3 | * All rights reserved 4 | * It is provided as it is for benchmark reproducible purpose. 5 | * anyone can use it for benchmark purpose with the 6 | * acknowledgement to TigerGraph. 7 | * Author: Litong Shen litong.shen@tigergraph.com 8 | */ 9 | import java.util.*; 10 | import java.io.BufferedReader; 11 | import java.io.FileInputStream; 12 | import java.io.IOException; 13 | import java.io.InputStreamReader; 14 | 15 | import org.apache.commons.configuration.BaseConfiguration; 16 | import org.apache.commons.configuration.Configuration; 17 | 18 | import org.janusgraph.core.schema.*; 19 | import org.janusgraph.util.datastructures.CompactMap; 20 | import org.janusgraph.core.util.*; 21 | import org.janusgraph.core.*; 22 | import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration; 23 | import org.janusgraph.graphdb.database.management.*; 24 | import org.janusgraph.graphdb.vertices.AbstractVertex; 25 | import org.janusgraph.graphdb.internal.ElementLifeCycle; 26 | import org.janusgraph.graphdb.vertices.StandardVertex; 27 | import org.janusgraph.graphdb.transaction.StandardJanusGraphTx; 28 | 29 | import java.io.FileWriter; 30 | 31 | 32 | public class singleThreadEdgeImporter { 33 | public static JanusGraph JanusG; 34 | public static int commitBatch = 1; 35 | 36 | private static HashMap idset1= new HashMap(); 37 | 38 | public static void main(String[] args){ 39 | String datasetDir = args[0]; 40 | String confPath = args[1]; 41 | commitBatch = Integer.parseInt(args[2]); 42 | String hashmapDir = args[3]; 43 | 44 | BaseConfiguration config = new BaseConfiguration(); 45 | 46 | JanusG = JanusGraphFactory.open(confPath); 47 | 48 | try { 49 | // edge reader 50 | BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(datasetDir))); 51 | String line; 52 | 53 | // hashmap reader 54 | BufferedReader hashmapReader = new BufferedReader(new InputStreamReader(new FileInputStream(hashmapDir))); 55 | String line2 = hashmapReader.readLine(); 56 | 57 | //create vertex hashmap without new vertex 58 | while((line2 = hashmapReader.readLine()) != null) { 59 | String[] kvPairs = line2.split("\t"); 60 | Long internalId = Long.parseLong(kvPairs[1]); 61 | idset1.put(kvPairs[0],internalId); 62 | } 63 | 64 | hashmapReader.close(); 65 | System.out.println("finished construct vertex hashmap"); 66 | 67 | //add edge 68 | 69 | long lineCounter = 0; 70 | long startTime = System.nanoTime(); 71 | 72 | // add edge with idset1(hashmap without create vertex) 73 | 74 | JanusGraphTransaction tx = JanusG.newTransaction(); 75 | while((line = reader.readLine()) != null) { 76 | try { 77 | String[] parts = line.split("\t"); 78 | addEdge(parts[0], parts[1], tx); 79 | lineCounter ++; 80 | if(lineCounter % commitBatch == 0) { 81 | System.out.println("---- commit ----: " + Long.toString(lineCounter / commitBatch)); 82 | tx.commit(); 83 | tx = JanusG.newTransaction(); 84 | } 85 | } catch (Exception e) { 86 | e.printStackTrace(); 87 | } 88 | } 89 | tx.commit(); 90 | 91 | long endTime = System.nanoTime(); 92 | long duration = (endTime - startTime); 93 | System.out.println("######## loading time ####### " + Long.toString(duration/1000000) + " ms"); 94 | reader.close(); 95 | } 96 | catch(IOException ioe) { 97 | ioe.printStackTrace(); 98 | } 99 | System.out.println("---- done ----"); 100 | System.exit(0); 101 | } 102 | 103 | 104 | /** this function add edge to graph 105 | * @para srcId the sourceId(internal id) of source vertex 106 | * @para dstId the dextionationId(internal id) of destination vertex 107 | * @para tx the current JanusGraph transaction 108 | */ 109 | private static void addEdge(String srcId, String dstId, JanusGraphTransaction tx) { 110 | Long srcInternalId = idset1.get(srcId); 111 | Long dstInternalId = idset1.get(dstId); 112 | JanusGraphVertex srcVertex, dstVertex; 113 | 114 | srcVertex = tx.getVertex(srcInternalId); 115 | dstVertex = tx.getVertex(dstInternalId); 116 | 117 | srcVertex.addEdge("MyEdge", dstVertex); 118 | } 119 | 120 | 121 | } 122 | -------------------------------------------------------------------------------- /benchmark/janusgraph/singleThreadGraph500Importer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-now, TigerGraph Inc. 3 | * All rights reserved 4 | * It is provided as it is for benchmark reproducible purpose. 5 | * anyone can use it for benchmark purpose with the 6 | * acknowledgement to TigerGraph. 7 | * Author: Weimo Liu weimo.liu@tigergraph.com 8 | * Modified by: Litong Shen litong.shen@tigergraph.com 9 | */ 10 | import java.util.*; 11 | import java.io.BufferedReader; 12 | import java.io.FileInputStream; 13 | import java.io.IOException; 14 | import java.io.InputStreamReader; 15 | 16 | import org.apache.commons.configuration.BaseConfiguration; 17 | import org.apache.commons.configuration.Configuration; 18 | 19 | import org.janusgraph.core.schema.*; 20 | import org.janusgraph.util.datastructures.CompactMap; 21 | import org.janusgraph.core.util.*; 22 | import org.janusgraph.core.*; 23 | import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration; 24 | import org.janusgraph.graphdb.database.management.*; 25 | 26 | import java.io.FileWriter; 27 | 28 | 29 | public class singleThreadGraph500Importer { 30 | public static JanusGraph JanusG; 31 | public static int commitBatch = 1; 32 | 33 | private static HashMap idset = new HashMap(); 34 | 35 | public static void main(String[] args){ 36 | String datasetDir = args[0]; 37 | String confPath = args[1]; 38 | commitBatch = Integer.parseInt(args[2]); 39 | 40 | BaseConfiguration config = new BaseConfiguration(); 41 | 42 | JanusG = JanusGraphFactory.open(confPath); 43 | JanusG.close(); 44 | JanusGraphCleanup.clear(JanusG); 45 | JanusG = JanusGraphFactory.open(confPath); 46 | 47 | ManagementSystem mgmt = (ManagementSystem) JanusG.openManagement(); 48 | mgmt.makeEdgeLabel("MyEdge").make(); 49 | mgmt.makeVertexLabel("MyNode").make(); 50 | PropertyKey id_key = mgmt.makePropertyKey("id").dataType(String.class).make(); 51 | //properties for pageRank 52 | 53 | PropertyKey pageRank_key = mgmt.makePropertyKey("gremlin.pageRankVertexProgram.pageRank").dataType(Double.class).make(); 54 | PropertyKey edgeCount_key = mgmt.makePropertyKey("gremlin.pageRankVertexProgram.edgeCount").dataType(Long.class).make(); 55 | 56 | //properties for WCC 57 | 58 | PropertyKey groupId_key = mgmt.makePropertyKey("WCC.groupId").dataType(Long.class).make(); 59 | 60 | 61 | mgmt.buildIndex("byId", JanusGraphVertex.class).addKey(id_key).unique().buildCompositeIndex(); 62 | mgmt.commit(); 63 | try{ 64 | mgmt.awaitGraphIndexStatus(JanusG, "byId").call(); 65 | } 66 | catch(Exception ex) { 67 | ex.printStackTrace(); 68 | System.exit(-1); 69 | } 70 | try { 71 | 72 | BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(datasetDir))); 73 | String line; 74 | long lineCounter = 0; 75 | long startTime = System.nanoTime(); 76 | while((line = reader.readLine()) != null) { 77 | try { 78 | String[] parts = line.split("\t"); 79 | 80 | processLine(parts[0], parts[1]); 81 | 82 | lineCounter++; 83 | if(lineCounter % commitBatch == 0){ 84 | System.out.println("---- commit ----: " + Long.toString(lineCounter / commitBatch)); 85 | JanusG.tx().commit(); 86 | } 87 | } catch (Exception e) { 88 | e.printStackTrace(); 89 | } 90 | } 91 | JanusG.tx().commit(); 92 | long endTime = System.nanoTime(); 93 | long duration = (endTime - startTime); 94 | System.out.println("######## loading time ####### " + Long.toString(duration/1000000) + " ms"); 95 | reader.close(); 96 | } 97 | catch(IOException ioe) { 98 | ioe.printStackTrace(); 99 | } 100 | System.out.println("---- done ----, total V: " + Integer.toString(idset.size())); 101 | System.exit(0); 102 | } 103 | 104 | /** This function add vertex and edge 105 | * @param srcId the source vertex of the edge 106 | * @param dstId the destination vertex of the edge 107 | */ 108 | 109 | private static void processLine(String srcId, String dstId) { 110 | JanusGraphVertex srcVertex = (JanusGraphVertex)idset.get(srcId); 111 | JanusGraphVertex dstVertex = (JanusGraphVertex)idset.get(dstId); 112 | if(srcVertex == null) { 113 | Long groupId = Long.parseLong(srcId); 114 | 115 | srcVertex = JanusG.addVertex("MyNode"); 116 | srcVertex.property("id", srcId); 117 | srcVertex.property("gremlin.pageRankVertexProgram.pageRank", 1.0); 118 | srcVertex.property("gremlin.pageRankVertexProgram.edgeCount", 0); 119 | srcVertex.property("WCC.groupId", groupId); 120 | 121 | idset.put(srcId, srcVertex); 122 | } 123 | if(dstVertex == null) { 124 | Long groupId = Long.parseLong(dstId); 125 | 126 | dstVertex = JanusG.addVertex("MyNode"); 127 | dstVertex.property("id", dstId); 128 | dstVertex.property("gremlin.pageRankVertexProgram.pageRank", 1.0); 129 | dstVertex.property("gremlin.pageRankVertexProgram.edgeCount", 0); 130 | dstVertex.property("WCC.groupId", groupId); 131 | 132 | idset.put(dstId, dstVertex); 133 | } 134 | 135 | srcVertex.addEdge("MyEdge", dstVertex); 136 | } 137 | 138 | 139 | } 140 | -------------------------------------------------------------------------------- /benchmark/janusgraph/singleThreadVertexImporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-now, TigerGraph Inc. 3 | * All rights reserved 4 | * It is provided as it is for benchmark reproducible purpose. 5 | * anyone can use it for benchmark purpose with the 6 | * acknowledgement to TigerGraph. 7 | * Author: Litong Shen litong.shen@tigergraph.com 8 | */ 9 | import java.util.*; 10 | import java.io.BufferedReader; 11 | import java.io.FileInputStream; 12 | import java.io.IOException; 13 | import java.io.InputStreamReader; 14 | 15 | import org.apache.commons.configuration.BaseConfiguration; 16 | import org.apache.commons.configuration.Configuration; 17 | 18 | import org.janusgraph.core.schema.*; 19 | import org.janusgraph.util.datastructures.CompactMap; 20 | import org.janusgraph.core.util.*; 21 | import org.janusgraph.core.*; 22 | import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration; 23 | import org.janusgraph.graphdb.database.management.*; 24 | import org.janusgraph.graphdb.vertices.AbstractVertex; 25 | import org.janusgraph.graphdb.internal.ElementLifeCycle; 26 | import org.janusgraph.graphdb.vertices.StandardVertex; 27 | import org.janusgraph.graphdb.transaction.StandardJanusGraphTx; 28 | 29 | import java.io.FileWriter; 30 | 31 | public class singleThreadVertexImporter { 32 | public static JanusGraph JanusG; 33 | public static int commitBatch = 1; 34 | private static HashMap idset = new HashMap(); 35 | 36 | public static void main(String[] args){ 37 | String datasetDir = args[0]; 38 | String confPath = args[1]; 39 | commitBatch = Integer.parseInt(args[2]); 40 | 41 | BaseConfiguration config = new BaseConfiguration(); 42 | 43 | JanusG = JanusGraphFactory.open(confPath); 44 | JanusG.close(); 45 | JanusGraphCleanup.clear(JanusG); 46 | JanusG = JanusGraphFactory.open(confPath); 47 | 48 | JanusGraphTransaction tx = JanusG.newTransaction(); 49 | 50 | ManagementSystem mgmt = (ManagementSystem) JanusG.openManagement(); 51 | mgmt.makeEdgeLabel("MyEdge").make(); 52 | mgmt.makeVertexLabel("MyNode").make(); 53 | PropertyKey id_key = mgmt.makePropertyKey("id").dataType(String.class).make(); 54 | PropertyKey pageRank_key = mgmt.makePropertyKey("gremlin.pageRankVertexProgram.pageRank").dataType(Double.class).make(); 55 | PropertyKey edgeCount_key = mgmt.makePropertyKey("gremlin.pageRankVertexProgram.edgeCount").dataType(Long.class).make(); 56 | PropertyKey groupId_key = mgmt.makePropertyKey("WCC.groupId").dataType(Long.class).make(); 57 | mgmt.buildIndex("byId", JanusGraphVertex.class).addKey(id_key).unique().buildCompositeIndex(); 58 | mgmt.commit(); 59 | try{ 60 | mgmt.awaitGraphIndexStatus(JanusG, "byId").call(); 61 | } 62 | catch(Exception ex) { 63 | ex.printStackTrace(); 64 | System.exit(-1); 65 | } 66 | 67 | String hashMapName = "test-hashMap"; 68 | String hashMapPath = "/Ebs/benchmark/code/janusgraph/data/" + hashMapName; 69 | 70 | try { 71 | FileWriter writer = new FileWriter(hashMapPath); 72 | writer.write("externalId\tinternalId\n"); 73 | 74 | BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(datasetDir))); 75 | String line; 76 | long lineCounter = 0; 77 | long startTime = System.nanoTime(); 78 | 79 | while((line = reader.readLine()) != null) { 80 | try { 81 | processLine(line, writer); 82 | lineCounter++; 83 | if(lineCounter % commitBatch == 0){ 84 | System.out.println("---- commit ----: " + Long.toString(lineCounter / commitBatch)); 85 | JanusG.tx().commit(); 86 | } 87 | 88 | } catch (Exception e) { 89 | e.printStackTrace(); 90 | } 91 | } 92 | 93 | JanusG.tx().commit(); 94 | writer.flush(); 95 | writer.close(); 96 | long endTime = System.nanoTime(); 97 | long duration = (endTime - startTime); 98 | System.out.println("######## time to generateVertexHashMap and load vertex file ####### " + Long.toString(duration/1000000) + " ms"); 99 | } catch (Exception e) { 100 | e.printStackTrace(); 101 | } 102 | 103 | System.out.println("---- done ----, total V: " + Integer.toString(idset.size())); 104 | System.exit(0); 105 | } 106 | 107 | /** this function add vertex to graph and write hashmap(vertex's externalId V.S. internalId) to disk 108 | * @para srcId the current processing vertex 109 | * @para writer the filewriter to write hashmap to disk 110 | */ 111 | private static void processLine(String srcId, FileWriter writer) { 112 | JanusGraphVertex srcVertex = (JanusGraphVertex)idset.get(srcId); 113 | if(srcVertex == null) { 114 | Long groupId = Long.parseLong(srcId); 115 | 116 | srcVertex = JanusG.addVertex("MyNode"); 117 | srcVertex.property("id", srcId); 118 | srcVertex.property("gremlin.pageRankVertexProgram.pageRank", 1.0); 119 | srcVertex.property("gremlin.pageRankVertexProgram.edgeCount", 0); 120 | srcVertex.property("WCC.groupId", groupId); 121 | 122 | idset.put(srcId, srcVertex); 123 | 124 | try { 125 | writer.write(srcId + "\t" + srcVertex.id() + "\n"); 126 | writer.flush(); 127 | } catch (Exception e) { 128 | e.printStackTrace(); 129 | } 130 | } 131 | 132 | } 133 | 134 | 135 | } 136 | -------------------------------------------------------------------------------- /benchmark/janusgraph/twitter-janusgraph-cassandra.properties: -------------------------------------------------------------------------------- 1 | # JanusGraph configuration sample: Cassandra over a socket 2 | # 3 | # This file connects to a Cassandra daemon running on localhost via 4 | # Thrift. Cassandra must already be started before starting JanusGraph 5 | # with this file. 6 | 7 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 8 | 9 | # The primary persistence provider used by JanusGraph. This is required. 10 | # It should be set one of JanusGraph's built-in shorthand names for its 11 | # standard storage backends (shorthands: berkeleyje, cassandrathrift, 12 | # cassandra, astyanax, embeddedcassandra, hbase, inmemory) or to the full 13 | # package and classname of a custom/third-party StoreManager 14 | # implementation. 15 | # 16 | # Default: (no default value) 17 | # Data Type: String 18 | # Mutability: LOCAL 19 | storage.backend=cassandrathrift 20 | #Jianlong#storage.backend=embeddedcassandra 21 | storage.batch-loading=true 22 | storage.cassandra.keyspace=twitter_hashMap 23 | 24 | storage.cassandra.frame-size-mb=128 25 | # The hostname or comma-separated list of hostnames of storage backend 26 | # servers. This is only applicable to some storage backends, such as 27 | # cassandra and hbase. 28 | # 29 | # Default: 127.0.0.1 30 | # Data Type: class java.lang.String[] 31 | # Mutability: LOCAL 32 | storage.hostname=127.0.0.1 33 | 34 | # Whether to enable JanusGraph's database-level cache, which is shared 35 | # across all transactions. Enabling this option speeds up traversals by 36 | # holding hot graph elements in memory, but also increases the likelihood 37 | # of reading stale data. Disabling it forces each transaction to 38 | # independently fetch graph elements from storage before reading/writing 39 | # them. 40 | # 41 | # Default: false 42 | # Data Type: Boolean 43 | # Mutability: MASKABLE 44 | #cache.db-cache = true 45 | 46 | # How long, in milliseconds, database-level cache will keep entries after 47 | # flushing them. This option is only useful on distributed storage 48 | # backends that are capable of acknowledging writes without necessarily 49 | # making them immediately visible. 50 | # 51 | # Default: 50 52 | # Data Type: Integer 53 | # Mutability: GLOBAL_OFFLINE 54 | # 55 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in 56 | # JanusGraph's storage backend. After starting the database for the first 57 | # time, this file's copy of this setting is ignored. Use JanusGraph's 58 | # Management System to read or modify this value after bootstrapping. 59 | #cache.db-cache-clean-wait = 20 60 | 61 | # Default expiration time, in milliseconds, for entries in the 62 | # database-level cache. Entries are evicted when they reach this age even 63 | # if the cache has room to spare. Set to 0 to disable expiration (cache 64 | # entries live forever or until memory pressure triggers eviction when set 65 | # to 0). 66 | # 67 | # Default: 10000 68 | # Data Type: Long 69 | # Mutability: GLOBAL_OFFLINE 70 | # 71 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in 72 | # JanusGraph's storage backend. After starting the database for the first 73 | # time, this file's copy of this setting is ignored. Use JanusGraph's 74 | # Management System to read or modify this value after bootstrapping. 75 | #cache.db-cache-time = 180000 76 | 77 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 78 | # interpreted as a percentage of VM heap, while larger values are 79 | # interpreted as an absolute size in bytes. 80 | # 81 | # Default: 0.3 82 | # Data Type: Double 83 | # Mutability: MASKABLE 84 | #cache.db-cache-size = 0.5 85 | 86 | ids.block-size = 48000000 87 | storage.transactions = false 88 | storage.write-time = 1000000 ms 89 | storage.cassandra.write-consistency-level = ANY 90 | storage.cassandra.read-consistency-level = ONE 91 | 90,1 Bot 92 | 93 | -------------------------------------------------------------------------------- /benchmark/janusgraph/twitter_rv.net-seed: -------------------------------------------------------------------------------- 1 | 20727483 50329304 26199460 1177521 27960125 30440025 15833920 15015183 33153097 21250581 28548532 42860945 22171728 15254388 44713775 44868770 16350915 33650477 56847735 18056455 32831346 56969867 73483 24981801 25726723 59109778 18381650 8467712 29781057 37886317 39357186 42520611 28471398 1288371 44112249 29088897 15568898 25038085 14075928 96 31835375 22480457 27104736 22687463 27576832 108 35792763 21373148 15234546 14379717 42744015 16927373 16727535 51520097 15078404 14199173 4517721 17323985 18218033 21828142 52674447 15285305 45827167 50826077 54064328 6941 33586608 204 22716284 34386420 36187082 31239408 40316879 10667662 46517052 24523660 14521821 18548221 41496166 27104314 27654423 1685871 23184686 23994973 60312372 8610562 38978212 19740592 18803424 30395784 35908081 21156271 20530182 23378124 29830423 44304625 28830907 31180323 17998925 46822485 42240052 45193938 53758197 20460235 52923055 16129920 15214045 19109927 15917338 27457788 38631864 50808075 19130449 11015592 24777262 14127710 28570061 29941438 15423869 20804997 22667467 26589987 45114047 18087450 961081 14231321 14050138 22742142 36412963 6444062 41608888 15492329 19632867 20194683 22286431 27558050 5120691 48570598 48459607 38407885 23686306 44807976 17129374 1775731 17872794 54491514 18812795 37479006 22281042 26116046 20841950 30244121 14854462 618593 19644074 15735493 43283406 24800750 22872869 20067354 15247448 20912620 20590051 14137268 20143330 18112970 17100967 16732759 54466171 52802702 20373034 32765375 24812106 11894652 51370393 3943871 53469420 14761795 365 46304581 3032431 20977546 21099347 42399917 796766 8909522 16460768 9121432 17919972 56643711 19226267 13221862 41259823 28466425 31806999 759251 59550897 22422221 14662772 15935591 36072333 14669432 14235317 46587124 33497221 41173269 14462907 15922433 22046932 8069572 17073811 19571299 23922282 37975089 71123 13141932 26784273 11172992 23718349 43097584 19829645 25365536 41213114 15683302 19867432 27923061 20536157 14610275 32959253 1045141 39940849 26591593 14293310 26149262 37889798 14803170 16548466 761393 17626181 1418 16609515 32629211 20534044 16797810 30096883 22508419 19124463 42532346 492 16278934 22787048 15163466 22382980 16557588 36880563 43146251 30859015 41716439 6102302 25555552 33370227 43251483 32209489 17910878 23742760 18979962 14230524 24608680 26643090 18659533 39616562 50848585 22359310 18954559 37440908 45251595 45830702 29861887 2884771 25941311 46484827 21407335 14987704 57721125 572 16350844 40926141 54916719 23511857 25515549 18591276 21035409 19923144 16841186 18583722 28335791 2557521 41470461 23006794 16418966 -------------------------------------------------------------------------------- /benchmark/janusgraph/vertex_loader.sh: -------------------------------------------------------------------------------- 1 | # this script use to load graph500/twitter vertex file and write hashmap (externalId : internalId) to disk 2 | # CLASSPATH (need to modify): e.g. "$CLASSPATH:/ebs/install/janusgraph/janusgraph-0.2.1-hadoop2/lib/*" 3 | # vertexImporter/class (need to modify): e.g. multiThreadVertexImporter 4 | # path/to/Vertex/file (need to modify): e.g. /ebs/raw/twitter_rv/twitter_rv.net_unique_node 5 | # path/to/Conf/file (need to modify): e.g. /ebs/install/janusgraph/conf/twitter-janusgraph-cassandra.properties 6 | 7 | export CLASSPATH="$CLASSPATH:path/to/lib/*" 8 | java -Xmx96g vertexImporter/class path/to/Vertex/file path/to/Conf/file 4000 9 | -------------------------------------------------------------------------------- /benchmark/neo4j/config.py: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | 10 | import os 11 | 12 | NEO4J_BOLT= os.environ.get("NEO4J_BOLT", "bolt://127.0.0.1:7687") 13 | TIGERGRAPH_HTTP = os.environ.get("TIGERGRAPH_HTTP", "http://127.0.0.1:9000") 14 | -------------------------------------------------------------------------------- /benchmark/neo4j/graph500-22-seed: -------------------------------------------------------------------------------- 1 | 3600312 2677094 2038005 3301167 704219 1779962 2681401 2277366 1649130 806220 3783689 3979771 2878950 1316789 4099483 2654216 3520283 320529 460890 2861567 1676721 3582851 2025534 1897682 3042164 683461 484783 2964318 825304 2303395 3029190 2119218 341236 3921645 3350720 1382338 2497566 2293317 1365818 3108349 1039487 656628 326459 3486463 1513849 3120768 3254104 2859677 4100533 1214662 2844418 3228461 2971789 838862 3242202 231946 103480 745855 2202837 121973 2944986 3916778 1237877 2404335 3903782 3753107 2638320 3532534 3026267 149529 2522099 1565761 1345848 1059426 2994540 1629629 1481421 337894 2706001 342515 2301230 3455722 4103891 2560844 316796 3853684 2803721 2782143 4168065 1297201 2982970 1089600 3589606 1978189 514482 773765 1929789 2499474 1367644 3052548 2020748 1934532 2595851 1265635 2678981 3484689 2778764 323958 1972929 2529296 2638682 2836761 3489646 2304697 3006908 3976118 432800 3408347 3184190 2478197 3990575 3097880 259436 479595 2054949 1014166 2398658 3499821 289302 2689848 603652 2764479 3458769 2372488 3826201 610619 1502380 1417031 1291296 1699680 1816799 2952048 3747093 996609 1906969 712790 1973404 2874441 4072076 534367 2419131 3145715 1172458 2547240 579284 3952328 3217974 928922 2975442 3686619 143324 2262470 2844253 3960743 95176 2661831 289798 498881 459455 3778765 2575099 2321106 898887 1630163 3268706 25081 3747551 2048028 1377545 2178454 3666746 1692598 1809240 1461949 3878592 96570 4095479 2539031 364055 3514283 3843398 3556803 2592596 168 2336570 327991 2445956 1140337 2663510 2514997 1933620 1076164 3734798 99836 2404509 3102298 2158818 3088473 3861233 1453810 1952126 968226 594138 1059034 408333 3246311 587844 1602562 2546319 2861944 1360827 1915610 957424 1427107 433135 3353932 140407 1989222 1392471 1290284 2144691 1299024 764990 302910 4192735 3181076 1535127 263980 1571976 2271738 492328 3976408 1621372 3024237 3229179 2167063 102878 4085765 2370758 2987431 2633916 1177859 1581601 18147 697579 3491436 699069 1608362 2570730 3929663 1304943 3733946 2216412 3013035 261001 32290 113329 1509856 2190260 3103760 3687843 1245035 3341532 857395 3942814 3982809 2807038 3291942 1840809 760204 3108890 1416278 3725922 2189358 2810970 655805 63077 3708992 2622204 1647516 1274701 2238470 83658 3800740 3659055 740181 318596 1353213 3058396 3497001 -------------------------------------------------------------------------------- /benchmark/neo4j/kn.sh: -------------------------------------------------------------------------------- 1 | nohup python kn.py /home/ubuntu/ecosys/benchmark/neo4j/twitter_rv.net-seed 300 neo4j 1 notes latency;nohup python kn.py /home/ubuntu/ecosys/benchmark/neo4j/twitter_rv.net-seed 300 neo4j 2 notes latency;nohup python kn.py /home/ubuntu/ecosys/benchmark/neo4j/twitter_rv.net-seed 10 neo4j 3 notes latency;nohup python kn.py /home/ubuntu/ecosys/benchmark/neo4j/twitter_rv.net-seed 10 neo4j 6 notes latency 2 | 3 | 4 | -------------------------------------------------------------------------------- /benchmark/neo4j/neo4j_load_graph500.sh: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | 10 | 11 | # This command will invoke neo4j-import to 12 | # do bulk load of graph500 data 13 | 14 | if [ ! -d "$1" ]; then 15 | echo "Input is not a valid path." 16 | echo "Usage: ./neo4j_load_graph500.sh neo4j_home_folder data_folder" 17 | echo "E.g. ./neo4j_load_graph500.sh /ebs/install/neo4j/neo4j-community-3.4.4 /ebs/data/graph500" 18 | exit 1 19 | fi 20 | 21 | rm -rf $1/data/databases/graph500.db 22 | 23 | $1/bin/neo4j-import --into $1/data/databases/graph500.db --id-type string --nodes:MyNode "$2/graph500-22-node-header.txt,$2/graph500-22_unique_node" --skip-duplicate-nodes --delimiter "\t" --relationships:MyEdge "$2/graph500-22-edge-header.txt,$2/graph500-22" 24 | -------------------------------------------------------------------------------- /benchmark/neo4j/neo4j_load_twitter.sh: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | 10 | # This command will invoke neo4j-import to 11 | # do bulk load of twitter data 12 | 13 | if [ ! -d "$1" ]; then 14 | echo "Input is not a valid path." 15 | echo "Usage: ./neo4j_load_twitter.sh neo4j_home_folder data_folder" 16 | echo "E.g. ./neo4j_load_twitter.sh /ebs/install/neo4j/neo4j-community-3.4.4 /ebs/data/twitter" 17 | exit 1 18 | fi 19 | 20 | rm -rf $1/data/databases/twitter_rv.db 21 | 22 | $1/bin/neo4j-import --into $1/data/databases/twitter.db --id-type string --nodes:MyNode "$2/twitter_rv-node-header.txt,$2/twitter_rv.net_unique_node" --skip-duplicate-nodes --delimiter "\t" --relationships:MyEdge "$2/twitter_rv-edge-header.txt,$2/twitter_rv.net" 23 | -------------------------------------------------------------------------------- /benchmark/neo4j/pg.py: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | 10 | import random 11 | import sys 12 | import os 13 | import datetime 14 | from timeit import default_timer as timer 15 | 16 | from query_runner import * 17 | from config import * 18 | 19 | 20 | ########################################################### 21 | # PageRank benchmark 22 | ########################################################### 23 | 24 | def RunPG(filename, db_name, num_iteration, num_tests, notes = ""): 25 | """ 26 | #test,num_iteration,time 27 | ... 28 | summary,num_iteration,average_time 29 | """ 30 | #create result folder 31 | if not os.path.exists(os.path.dirname("./result/")): 32 | try: 33 | os.makedirs(os.path.dirname("./result/")) 34 | except OSError as exc: # Guard against race condition 35 | if exc.errno != errno.EEXIST: 36 | raise 37 | 38 | ofile = open("result/PG-latency-" + db_name + "-" + filename, 'a') 39 | if db_name == "neo4j": 40 | runner = Neo4jQueryRunner() 41 | elif db_name == "tigergraph": 42 | runner = TigerGraphQueryRunner() 43 | else: 44 | print("invalid db " + db_name) 45 | total_time = 0.0 46 | total_knsize = 0 47 | report = "\n---------- " + str(datetime.datetime.now()) + " " + notes + " ----------\n" 48 | for i in range(0, num_tests): 49 | start = timer() 50 | runner.PG(num_iteration) 51 | end = timer() 52 | exe_time = end - start 53 | total_time += exe_time 54 | line = str(i) + "," + str(num_iteration) + "," + str(exe_time) + " seconds" 55 | print(line) 56 | report += line + "\n" 57 | report += "summary," + str(num_iteration) + "," + str(total_time/num_tests) + " seconds" 58 | ofile.write(report) 59 | print (report) 60 | 61 | 62 | if __name__ == "__main__": 63 | # kn.py file_name db_name num_iteration 64 | if len(sys.argv) < 5: 65 | print("Usage: python pg.py raw_file_name db_name num_iteration num_tests") 66 | sys.exit() 67 | # python pg.py graph500-22 neo4j 1 2 68 | RunPG(os.path.basename(sys.argv[1]), sys.argv[2], int(sys.argv[3]), int(sys.argv[4]), sys.argv[5] if len(sys.argv) == 6 else "") 69 | -------------------------------------------------------------------------------- /benchmark/neo4j/query_runner.py: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | 10 | import requests 11 | 12 | from neo4j.v1 import GraphDatabase, basic_auth 13 | 14 | import config 15 | 16 | class QueryRunner(): 17 | def __init__(self): 18 | pass 19 | 20 | def KN(self, root): 21 | pass 22 | 23 | def SSSP(self, root): 24 | pass 25 | 26 | def PG(self): 27 | pass 28 | 29 | def WCC(self): 30 | pass 31 | 32 | def LCC(self): 33 | pass 34 | 35 | 36 | 37 | class Neo4jQueryRunner(QueryRunner): 38 | def __init__(self, url = config.NEO4J_BOLT): 39 | QueryRunner.__init__(self) 40 | self.driver = GraphDatabase.driver(url, auth=basic_auth("neo4j", "benchmark")) 41 | self.session = self.driver.session() 42 | 43 | def KN(self, root, depth): 44 | 45 | try: 46 | # a path of length depth, if a node is 1-hop away, and also 2-hop away, we count it in 2-hop set. 47 | result = self.session.run("match (n1:MyNode)-[:MyEdge*" + str(depth) + "]->(n2:MyNode) where n1.id={root} return count(distinct n2)", {"root":root}) 48 | record = result.peek() 49 | except: #timeout, we return -1, reset session 50 | self.session.close() 51 | self.session = self.driver.session() 52 | return -1 53 | else: 54 | return record["count(distinct n2)"] 55 | 56 | def PG(self, iteration): 57 | result = self.session.run("MATCH (node:MyNode) WITH COLLECT(node) AS nodes CALL apoc.algo.pageRankWithConfig(nodes,{iterations:{iteration}}) YIELD node, score RETURN node, score LIMIT 1", {"iteration":iteration}) 58 | record = result.peek() 59 | return record 60 | 61 | def WCC(self): 62 | result = self.session.run("CALL apoc.algo.wcc() yield stats return count(*)") 63 | record = result.peek() 64 | return record 65 | 66 | #build index 67 | def Index(self, att, typename): 68 | result = self.session.run("CREATE INDEX ON :{typename}({att});", {"typename":typename, "att":att}) 69 | 70 | record = result.peek() 71 | 72 | 73 | class TigerGraphQueryRunner(QueryRunner): 74 | def __init__(self, url = config.TIGERGRAPH_HTTP): 75 | QueryRunner.__init__(self) 76 | self.session = requests.Session() 77 | self.url = url 78 | 79 | def KN(self, root, depth): 80 | result = self.session.get(self.url + "/query/khop", params={'start_node': root, "depth":depth}).json() 81 | return result["results"][0]["Start.size()"] 82 | 83 | def PG(self, iteration): 84 | result = self.session.get(self.url + "/query/pagerank", params={'iteration': iteration, "dampingFactor":0.8}).json() 85 | print (result) 86 | 87 | def WCC(self): 88 | result = self.session.get(self.url + "/query/wcc").json() 89 | print (result) 90 | 91 | if __name__ == "__main__": 92 | runner = TigerGraphQueryRunner() 93 | runner.PG(100) 94 | -------------------------------------------------------------------------------- /benchmark/neo4j/result/KN-latency-neo4j-graph500-22-seed-k3: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-03 23:38:12.964810 notes ---------- 3 | 3600312,1519273,30.411701636010548 4 | 2677094,285633,1.2157209000142757 5 | 2038005,1553376,25.40827759198146 6 | 3301167,2018347,97.03945093101356 7 | 704219,26549,0.06081289201392792 8 | 1779962,1520027,28.983773559011752 9 | 2681401,2075644,168.9834214389848 10 | 2277366,1682414,37.082872318977024 11 | 1649130,2099589,88.88358171802247 12 | 806220,1532485,35.71657397900708 13 | summary, avg knsize=1431333.7, avg query time=51.37861869650369s, timeout query cnt=0 -------------------------------------------------------------------------------- /benchmark/neo4j/result/KN-latency-neo4j-graph500-22-seed-k6: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-02 01:36:37.247118 notes ---------- 3 | 3600312,0,0.054749041999457404 4 | 2677094,0,0.00124059399968246 5 | 2038005,0,0.0010628230011207052 6 | 3301167,0,0.0010530079998716246 7 | 704219,0,0.0010351329983677715 8 | 1779962,0,0.000893995998922037 9 | 2681401,0,0.0008914040008676238 10 | 2277366,0,0.0008772580004006159 11 | 1649130,0,0.0008923799978219904 12 | 806220,0,0.0010665859990695026 13 | summary, avg knsize=0.0, avg query time=0.006376222399558174s, timeout query cnt=0 14 | ---------- 2018-08-02 06:15:28.267205 notes ---------- 15 | 2677094,510565,2606.4164088439993 16 | 704219,391780,18.965611380001064 17 | summary, avg knsize=451172.5, avg query time=1312.6910101120002s, timeout query cnt=8 -------------------------------------------------------------------------------- /benchmark/neo4j/result/KN-latency-neo4j-twitter_rv.net-seed-k3: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-02 02:15:43.952908 notes ---------- 3 | 20727483,18098900,203.30038395099837 4 | 50329304,20303955,675.2356235360021 5 | 27960125,2022164,8.301794340004562 6 | 30440025,18571303,305.03540438300115 7 | summary, avg knsize=14749080.5, avg query time=297.96830155250154s, timeout query cnt=6 -------------------------------------------------------------------------------- /benchmark/neo4j/result/KN-latency-neo4j-twitter_rv.net-seed-k6: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-02 18:00:28.093678 notes ---------- 3 | summary, avg knsize=NA, avg query time=NAs, timeout query cnt=10 -------------------------------------------------------------------------------- /benchmark/neo4j/result/PG-latency-neo4j-graph500-22: -------------------------------------------------------------------------------- 1 | ---------- 2018-08-03 19:51:59.439681 ---------- 2 | 0,10,30.717444998997962 seconds 3 | 1,10,30.61156114799087 seconds 4 | 2,10,29.47239070700016 seconds 5 | summary,10,30.267132284662996 seconds 6 | -------------------------------------------------------------------------------- /benchmark/neo4j/result/PG-latency-neo4j-twitter-rv: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-06 19:53:00.030535 ---------- 3 | 0,10,618.5317208199995 seconds 4 | 1,10,615.6653600390127 seconds 5 | 2,10,610.6767529860081 seconds 6 | summary,10,614.9579446150068 seconds -------------------------------------------------------------------------------- /benchmark/neo4j/result/WCC-latency-neo4j-graph500-22: -------------------------------------------------------------------------------- 1 | ---------- 2018-08-03 19:49:29.308717 ---------- 2 | 0,48.699528951983666 3 | 1,50.019225283002015 4 | 2,51.177970599004766 5 | summary, avg time 49.96557494466348 seconds 6 | -------------------------------------------------------------------------------- /benchmark/neo4j/result/WCC-latency-neo4j-twitter-rv: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-06 18:58:19.986403 ---------- 3 | 0,1090.656010540988 4 | 1,1094.0103726370144 5 | 2,1095.1249378689972 6 | summary, avg time 1093.2637736823333 seconds -------------------------------------------------------------------------------- /benchmark/neo4j/twitter_rv.net-seed: -------------------------------------------------------------------------------- 1 | 20727483 50329304 26199460 1177521 27960125 30440025 15833920 15015183 33153097 21250581 28548532 42860945 22171728 15254388 44713775 44868770 16350915 33650477 56847735 18056455 32831346 56969867 73483 24981801 25726723 59109778 18381650 8467712 29781057 37886317 39357186 42520611 28471398 1288371 44112249 29088897 15568898 25038085 14075928 96 31835375 22480457 27104736 22687463 27576832 108 35792763 21373148 15234546 14379717 42744015 16927373 16727535 51520097 15078404 14199173 4517721 17323985 18218033 21828142 52674447 15285305 45827167 50826077 54064328 6941 33586608 204 22716284 34386420 36187082 31239408 40316879 10667662 46517052 24523660 14521821 18548221 41496166 27104314 27654423 1685871 23184686 23994973 60312372 8610562 38978212 19740592 18803424 30395784 35908081 21156271 20530182 23378124 29830423 44304625 28830907 31180323 17998925 46822485 42240052 45193938 53758197 20460235 52923055 16129920 15214045 19109927 15917338 27457788 38631864 50808075 19130449 11015592 24777262 14127710 28570061 29941438 15423869 20804997 22667467 26589987 45114047 18087450 961081 14231321 14050138 22742142 36412963 6444062 41608888 15492329 19632867 20194683 22286431 27558050 5120691 48570598 48459607 38407885 23686306 44807976 17129374 1775731 17872794 54491514 18812795 37479006 22281042 26116046 20841950 30244121 14854462 618593 19644074 15735493 43283406 24800750 22872869 20067354 15247448 20912620 20590051 14137268 20143330 18112970 17100967 16732759 54466171 52802702 20373034 32765375 24812106 11894652 51370393 3943871 53469420 14761795 365 46304581 3032431 20977546 21099347 42399917 796766 8909522 16460768 9121432 17919972 56643711 19226267 13221862 41259823 28466425 31806999 759251 59550897 22422221 14662772 15935591 36072333 14669432 14235317 46587124 33497221 41173269 14462907 15922433 22046932 8069572 17073811 19571299 23922282 37975089 71123 13141932 26784273 11172992 23718349 43097584 19829645 25365536 41213114 15683302 19867432 27923061 20536157 14610275 32959253 1045141 39940849 26591593 14293310 26149262 37889798 14803170 16548466 761393 17626181 1418 16609515 32629211 20534044 16797810 30096883 22508419 19124463 42532346 492 16278934 22787048 15163466 22382980 16557588 36880563 43146251 30859015 41716439 6102302 25555552 33370227 43251483 32209489 17910878 23742760 18979962 14230524 24608680 26643090 18659533 39616562 50848585 22359310 18954559 37440908 45251595 45830702 29861887 2884771 25941311 46484827 21407335 14987704 57721125 572 16350844 40926141 54916719 23511857 25515549 18591276 21035409 19923144 16841186 18583722 28335791 2557521 41470461 23006794 16418966 -------------------------------------------------------------------------------- /benchmark/neo4j/wcc.py: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | import random 10 | import sys 11 | import os 12 | import datetime 13 | import errno 14 | 15 | from timeit import default_timer as timer 16 | 17 | from query_runner import * 18 | from config import * 19 | 20 | 21 | ########################################################### 22 | # Weakly Connected Component benchmark 23 | ########################################################### 24 | 25 | def RunWCC(filename, db_name, num_tests, notes = ""): 26 | """ 27 | #test,time 28 | ... 29 | summary,average_time 30 | """ 31 | #create result folder 32 | if not os.path.exists(os.path.dirname("./result/")): 33 | try: 34 | os.makedirs(os.path.dirname("./result/")) 35 | except OSError as exc: # Guard against race condition 36 | if exc.errno != errno.EEXIST: 37 | raise 38 | 39 | 40 | ofile = open("result/WCC-latency-" + db_name + "-" + filename, 'a') 41 | if db_name == "neo4j": 42 | runner = Neo4jQueryRunner() 43 | elif db_name == "tigergraph": 44 | runner = TigerGraphQueryRunner() 45 | else: 46 | print("invalid db " + db_name) 47 | total_time = 0.0 48 | report = "\n---------- " + str(datetime.datetime.now()) + " " + notes + " ----------\n" 49 | for i in range(0, num_tests): 50 | start = timer() 51 | runner.WCC() 52 | end = timer() 53 | exe_time = end - start 54 | total_time += exe_time 55 | line = str(i) + "," + str(exe_time) 56 | report += line + "\n" 57 | report += "summary, avg time " + str(total_time/num_tests) + " seconds" 58 | ofile.write(report) 59 | print (report) 60 | 61 | 62 | if __name__ == "__main__": 63 | # kn.py file_name db_name num_test 64 | if len(sys.argv) < 4: 65 | print("Usage: python wcc.py file_name db_name num_tests") 66 | print("e.g. python wcc.py /data/graph500/graph500-22 neo4j 3") 67 | print("e.g. python wcc.py /data/graph500/graph500-22 tigergraph 3") 68 | 69 | sys.exit() 70 | 71 | RunWCC(os.path.basename(sys.argv[1]), sys.argv[2], int(sys.argv[3]), sys.argv[4] if len(sys.argv) == 5 else "") 72 | -------------------------------------------------------------------------------- /benchmark/neptune/cancel_loading.sh: -------------------------------------------------------------------------------- 1 | # this script used to delete the loader job with the job id 2 | # "your-neptune-endpoint" (need to modify): obtain from Neptune instance page and it is in Details section, marked as "Endpoint" 3 | # $1 is the argument of job id which returned by Neptune loader 4 | 5 | curl -X DELETE "http:/your-neptune-endpoint:8182/loader/$1" 6 | -------------------------------------------------------------------------------- /benchmark/neptune/check_load.sh: -------------------------------------------------------------------------------- 1 | # this sript used to get the status of the load with the loadId from previous step 2 | # "your-neptune-endpoint" (need to modify): obtain from Neptune instance page and it is in Details section, marked as "Endpoint" 3 | # $1 is the argument for loadId, which is returned by Neptune loader 4 | 5 | curl -G "http:/your-neptune-endpoint:8182/loader/$1" 6 | -------------------------------------------------------------------------------- /benchmark/neptune/graph500-22-seed: -------------------------------------------------------------------------------- 1 | 3600312 2677094 2038005 3301167 704219 1779962 2681401 2277366 1649130 806220 3783689 3979771 2878950 1316789 4099483 2654216 3520283 320529 460890 2861567 1676721 3582851 2025534 1897682 3042164 683461 484783 2964318 825304 2303395 3029190 2119218 341236 3921645 3350720 1382338 2497566 2293317 1365818 3108349 1039487 656628 326459 3486463 1513849 3120768 3254104 2859677 4100533 1214662 2844418 3228461 2971789 838862 3242202 231946 103480 745855 2202837 121973 2944986 3916778 1237877 2404335 3903782 3753107 2638320 3532534 3026267 149529 2522099 1565761 1345848 1059426 2994540 1629629 1481421 337894 2706001 342515 2301230 3455722 4103891 2560844 316796 3853684 2803721 2782143 4168065 1297201 2982970 1089600 3589606 1978189 514482 773765 1929789 2499474 1367644 3052548 2020748 1934532 2595851 1265635 2678981 3484689 2778764 323958 1972929 2529296 2638682 2836761 3489646 2304697 3006908 3976118 432800 3408347 3184190 2478197 3990575 3097880 259436 479595 2054949 1014166 2398658 3499821 289302 2689848 603652 2764479 3458769 2372488 3826201 610619 1502380 1417031 1291296 1699680 1816799 2952048 3747093 996609 1906969 712790 1973404 2874441 4072076 534367 2419131 3145715 1172458 2547240 579284 3952328 3217974 928922 2975442 3686619 143324 2262470 2844253 3960743 95176 2661831 289798 498881 459455 3778765 2575099 2321106 898887 1630163 3268706 25081 3747551 2048028 1377545 2178454 3666746 1692598 1809240 1461949 3878592 96570 4095479 2539031 364055 3514283 3843398 3556803 2592596 168 2336570 327991 2445956 1140337 2663510 2514997 1933620 1076164 3734798 99836 2404509 3102298 2158818 3088473 3861233 1453810 1952126 968226 594138 1059034 408333 3246311 587844 1602562 2546319 2861944 1360827 1915610 957424 1427107 433135 3353932 140407 1989222 1392471 1290284 2144691 1299024 764990 302910 4192735 3181076 1535127 263980 1571976 2271738 492328 3976408 1621372 3024237 3229179 2167063 102878 4085765 2370758 2987431 2633916 1177859 1581601 18147 697579 3491436 699069 1608362 2570730 3929663 1304943 3733946 2216412 3013035 261001 32290 113329 1509856 2190260 3103760 3687843 1245035 3341532 857395 3942814 3982809 2807038 3291942 1840809 760204 3108890 1416278 3725922 2189358 2810970 655805 63077 3708992 2622204 1647516 1274701 2238470 83658 3800740 3659055 740181 318596 1353213 3058396 3497001 -------------------------------------------------------------------------------- /benchmark/neptune/json.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaolk/graph-database-benchmark/1137e220106597edaabc712a9cd7e67e75182b7a/benchmark/neptune/json.jar -------------------------------------------------------------------------------- /benchmark/neptune/load.sh: -------------------------------------------------------------------------------- 1 | # this script used to load data from S3 to Neptune 2 | # "your-neptune-endpoint" (need to modify): check from Neptune instance page and it is in Details section, marked as "Endpoint" 3 | # "bucket-name" (need to modify): is your bucket-name in S3 4 | # "object-key-name" (need to modify): is the entire path of a file in S3, including the file name. 5 | # "account-id" and "role-name" (need to modify): in aws console, check "My Security Credentials" from drop bar, check "Roles" 6 | # from left side, then check correct role name. "iamRoleArn" list in Summary page 7 | 8 | curl -X POST -H 'Content-Type: application/json' http://your-neptune-endpoint:8182/loader -d ' { 9 | "source" : "s3://bucket-name/object-key-name", 10 | "format" : "csv", 11 | "iamRoleArn" : "arn:aws:iam::account-id:role/role-name", "region" : "us-east-1", 12 | "failOnError" : "FALSE" 13 | }' 14 | -------------------------------------------------------------------------------- /benchmark/neptune/result/4xlarge-KN-latency-Graph500-1: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 3600312, 723, 661 3 | 2677094, 82, 11 4 | 2038005, 257, 9 5 | 3301167, 2691, 30 6 | 704219, 7, 8 7 | 1779962, 669, 15 8 | 2681401, 8532, 51 9 | 2277366, 809, 14 10 | 1649130, 967, 15 11 | 806220, 2101, 14 12 | 3783689, 868, 11 13 | 3979771, 23306, 103 14 | 2878950, 2397, 13 15 | 1316789, 91, 6 16 | 4099483, 158, 6 17 | 2654216, 2935, 12 18 | 3520283, 68, 5 19 | 320529, 940, 7 20 | 460890, 1213, 7 21 | 2861567, 18, 5 22 | 1676721, 997, 7 23 | 3582851, 61, 7 24 | 2025534, 1596, 8 25 | 1897682, 79, 5 26 | 3042164, 91, 4 27 | 683461, 8913, 25 28 | 484783, 1675, 9 29 | 2964318, 2, 4 30 | 825304, 92, 4 31 | 2303395, 22950, 49 32 | 3029190, 201, 5 33 | 2119218, 2930, 11 34 | 341236, 7391, 18 35 | 3921645, 160, 4 36 | 3350720, 11325, 25 37 | 1382338, 2624, 9 38 | 2497566, 6704, 18 39 | 2293317, 91, 4 40 | 1365818, 226, 4 41 | 3108349, 248, 4 42 | 1039487, 84, 3 43 | 656628, 1941, 7 44 | 326459, 161, 5 45 | 3486463, 838, 5 46 | 1513849, 576, 4 47 | 3120768, 26, 3 48 | 3254104, 1812, 7 49 | 2859677, 47, 3 50 | 4100533, 6961, 16 51 | 1214662, 969, 5 52 | 2844418, 2016, 7 53 | 3228461, 29, 3 54 | 2971789, 2509, 8 55 | 838862, 227, 4 56 | 3242202, 67601, 134 57 | 231946, 49, 4 58 | 103480, 1247, 6 59 | 745855, 81, 4 60 | 2202837, 542, 4 61 | 121973, 1710, 6 62 | 2944986, 5778, 14 63 | 3916778, 6272, 15 64 | 1237877, 28, 3 65 | 2404335, 189, 6 66 | 3903782, 18494, 38 67 | 3753107, 21916, 44 68 | 2638320, 8615, 20 69 | 3532534, 4484, 12 70 | 3026267, 7979, 18 71 | 149529, 2, 3 72 | 2522099, 292, 4 73 | 1565761, 2165, 7 74 | 1345848, 708, 5 75 | 1059426, 504, 4 76 | 2994540, 9118, 20 77 | 1629629, 6958, 16 78 | 1481421, 2811, 9 79 | 337894, 804, 5 80 | 2706001, 467, 4 81 | 342515, 2739, 8 82 | 2301230, 673, 4 83 | 3455722, 2248, 7 84 | 4103891, 215, 3 85 | 2560844, 2114, 7 86 | 316796, 885, 5 87 | 3853684, 173, 5 88 | 2803721, 525, 6 89 | 2782143, 60, 4 90 | 4168065, 98, 3 91 | 1297201, 247, 4 92 | 2982970, 163501, 339 93 | 1089600, 2349, 8 94 | 3589606, 28, 3 95 | 1978189, 2700, 8 96 | 514482, 1430, 6 97 | 773765, 65, 4 98 | 1929789, 73, 3 99 | 2499474, 25325, 51 100 | 1367644, 2763, 8 101 | 3052548, 2991, 9 102 | 2020748, 611, 4 103 | 1934532, 296, 4 104 | 2595851, 1227, 5 105 | 1265635, 682, 4 106 | 2678981, 147, 3 107 | 3484689, 709, 4 108 | 2778764, 270, 4 109 | 323958, 883, 5 110 | 1972929, 2, 3 111 | 2529296, 6922, 16 112 | 2638682, 102, 3 113 | 2836761, 736, 5 114 | 3489646, 24586, 50 115 | 2304697, 25538, 51 116 | 3006908, 53, 3 117 | 3976118, 8280, 19 118 | 432800, 133, 4 119 | 3408347, 805, 5 120 | 3184190, 57, 3 121 | 2478197, 98, 4 122 | 3990575, 986, 5 123 | 3097880, 13, 3 124 | 259436, 2841, 8 125 | 479595, 44, 3 126 | 2054949, 20, 3 127 | 1014166, 36, 3 128 | 2398658, 695, 5 129 | 3499821, 8717, 21 130 | 289302, 25637, 51 131 | 2689848, 769, 5 132 | 603652, 264, 3 133 | 2764479, 712, 4 134 | 3458769, 250, 3 135 | 2372488, 14, 3 136 | 3826201, 94, 3 137 | 610619, 7341, 17 138 | 1502380, 623, 4 139 | 1417031, 8246, 18 140 | 1291296, 67379, 134 141 | 1699680, 834, 5 142 | 1816799, 22, 3 143 | 2952048, 25084, 50 144 | 3747093, 68, 3 145 | 996609, 846, 5 146 | 1906969, 141, 3 147 | 712790, 25261, 51 148 | 1973404, 22, 3 149 | 2874441, 198, 3 150 | 4072076, 216, 3 151 | 534367, 18, 3 152 | 2419131, 11375, 25 153 | 3145715, 213, 3 154 | 1172458, 838, 5 155 | 2547240, 1929, 6 156 | 579284, 2917, 8 157 | 3952328, 6, 3 158 | 3217974, 6340, 16 159 | 928922, 2583, 8 160 | 2975442, 421, 4 161 | 3686619, 99, 3 162 | 143324, 101, 3 163 | 2262470, 1235, 5 164 | 2844253, 210, 3 165 | 3960743, 34, 3 166 | 95176, 27, 3 167 | 2661831, 62, 3 168 | 289798, 7961, 18 169 | 498881, 1364, 6 170 | 459455, 29, 3 171 | 3778765, 25507, 51 172 | 2575099, 315, 5 173 | 2321106, 20273, 41 174 | 898887, 8936, 20 175 | 1630163, 2254, 7 176 | 3268706, 270, 3 177 | 25081, 230, 3 178 | 3747551, 915, 4 179 | 2048028, 699, 4 180 | 1377545, 7796, 18 181 | 2178454, 25231, 52 182 | 3666746, 463, 4 183 | 1692598, 213, 3 184 | 1809240, 29, 3 185 | 1461949, 984, 5 186 | 3878592, 306, 3 187 | 96570, 572, 4 188 | 4095479, 7461, 17 189 | 2539031, 328, 3 190 | 364055, 2880, 8 191 | 3514283, 8739, 19 192 | 3843398, 667, 4 193 | 3556803, 338, 4 194 | 2592596, 2779, 8 195 | 168, 2978, 8 196 | 2336570, 58, 3 197 | 327991, 2664, 8 198 | 2445956, 7478, 18 199 | 1140337, 22973, 46 200 | 2663510, 65106, 125 201 | 2514997, 756, 5 202 | 1933620, 9066, 19 203 | 1076164, 8471, 19 204 | 3734798, 66, 3 205 | 99836, 823, 4 206 | 2404509, 2413, 8 207 | 3102298, 80, 3 208 | 2158818, 9068, 20 209 | 3088473, 15, 3 210 | 3861233, 204, 3 211 | 1453810, 4, 3 212 | 1952126, 373, 3 213 | 968226, 2213, 8 214 | 594138, 2274, 7 215 | 1059034, 823, 5 216 | 408333, 13, 3 217 | 3246311, 10, 3 218 | 587844, 1855, 6 219 | 1602562, 174, 3 220 | 2546319, 8471, 18 221 | 2861944, 898, 4 222 | 1360827, 67265, 130 223 | 1915610, 4392, 12 224 | 957424, 3181, 9 225 | 1427107, 53, 3 226 | 433135, 88, 3 227 | 3353932, 628, 4 228 | 140407, 863, 4 229 | 1989222, 753, 4 230 | 1392471, 23602, 46 231 | 1290284, 8027, 18 232 | 2144691, 18311, 37 233 | 1299024, 44, 3 234 | 764990, 880, 4 235 | 302910, 1225, 5 236 | 4192735, 829, 4 237 | 3181076, 658, 4 238 | 1535127, 2818, 8 239 | 263980, 1690, 6 240 | 1571976, 924, 4 241 | 2271738, 1766, 6 242 | 492328, 1615, 6 243 | 3976408, 216, 3 244 | 1621372, 731, 4 245 | 3024237, 90, 3 246 | 3229179, 62056, 120 247 | 2167063, 24706, 50 248 | 102878, 2920, 8 249 | 4085765, 756, 4 250 | 2370758, 92, 3 251 | 2987431, 24070, 49 252 | 2633916, 240, 3 253 | 1177859, 25586, 54 254 | 1581601, 8960, 20 255 | 18147, 2839, 17 256 | 697579, 137, 4 257 | 3491436, 2932, 19 258 | 699069, 472, 5 259 | 1608362, 721, 4 260 | 2570730, 2772, 8 261 | 3929663, 21812, 43 262 | 1304943, 1491, 5 263 | 3733946, 6672, 16 264 | 2216412, 8577, 19 265 | 3013035, 26, 3 266 | 261001, 125, 3 267 | 32290, 23475, 46 268 | 113329, 8993, 19 269 | 1509856, 8320, 18 270 | 2190260, 515, 4 271 | 3103760, 866, 4 272 | 3687843, 2456, 7 273 | 1245035, 3, 3 274 | 3341532, 1724, 6 275 | 857395, 1702, 6 276 | 3942814, 3232, 9 277 | 3982809, 318, 4 278 | 2807038, 2806, 8 279 | 3291942, 242, 3 280 | 1840809, 3154, 9 281 | 760204, 47, 3 282 | 3108890, 4, 2 283 | 1416278, 53, 3 284 | 3725922, 25513, 51 285 | 2189358, 2842, 8 286 | 2810970, 359, 3 287 | 655805, 287, 3 288 | 63077, 2172, 7 289 | 3708992, 8508, 18 290 | 2622204, 31, 3 291 | 1647516, 529, 4 292 | 1274701, 511, 4 293 | 2238470, 1118, 5 294 | 83658, 928, 4 295 | 3800740, 6111, 14 296 | 3659055, 921, 4 297 | 740181, 2691, 7 298 | 318596, 18172, 37 299 | 1353213, 641, 4 300 | 3058396, 275, 3 301 | 3497001, 212, 3 302 | ==================================================== 303 | number of start vertex: 300 304 | number of query didn't finish correctly: 0 305 | total neighbor size: 1538526 306 | total query time: 4736.0 307 | average neighbor size: 5128.42 308 | average query time: 15.786666666666667 309 | -------------------------------------------------------------------------------- /benchmark/neptune/result/4xlarge-KN-latency-Graph500-3: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 3600312, -1, -1 3 | 2677094, 285633, 4135 4 | 2038005, -1, -1 5 | 3301167, -1, -1 6 | 704219, 26549, 102 7 | 1779962, -1, -1 8 | 2681401, -1, -1 9 | 2277366, -1, -1 10 | 1649130, -1, -1 11 | 806220, -1, -1 12 | ==================================================== 13 | number of start vertex: 10 14 | number of query didn't finish correctly: 8 15 | total neighbor size: 312182 16 | total query time: 4237.0 17 | average neighbor size: 156091.0 18 | average query time: 2118.5 19 | -------------------------------------------------------------------------------- /benchmark/neptune/result/4xlarge-KN-latency-Graph500-6: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 3600312, -1, -1 3 | 2677094, -1, -1 4 | 2038005, -1, -1 5 | 3301167, -1, -1 6 | 704219, -1, -1 7 | 1779962, -1, -1 8 | 2681401, -1, -1 9 | 2277366, -1, -1 10 | 1649130, -1, -1 11 | 806220, -1, -1 12 | ==================================================== 13 | number of start vertex: 10 14 | number of query didn't finish correctly: 10 15 | total neighbor size: 0 16 | total query time: 0.0 17 | average neighbor size: NaN 18 | average query time: NaN 19 | -------------------------------------------------------------------------------- /benchmark/neptune/result/4xlarge-KN-latency-Twitter-3: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 20727483, -1, -1 3 | 50329304, -1, -1 4 | 26199460, -1, -1 5 | 1177521, -1, -1 6 | 27960125, 2022164, 38223 7 | 30440025, -1, -1 8 | 15833920, -1, -1 9 | 15015183, -1, -1 10 | 33153097, -1, -1 11 | 21250581, -1, -1 12 | ==================================================== 13 | number of start vertex: 10 14 | number of query didn't finish correctly: 9 15 | total neighbor size: 2022164 16 | total query time: 38223.0 17 | average neighbor size: 2022164.0 18 | average query time: 38223.0 19 | -------------------------------------------------------------------------------- /benchmark/neptune/result/4xlarge-KN-latency-Twitter-6: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 20727483, -1, -1 3 | 50329304, -1, -1 4 | 26199460, -1, -1 5 | 1177521, -1, -1 6 | 27960125, -1, -1 7 | 30440025, -1, -1 8 | 15833920, -1, -1 9 | 15015183, -1, -1 10 | 33153097, -1, -1 11 | 21250581, -1, -1 12 | ==================================================== 13 | number of start vertex: 10 14 | number of query didn't finish correctly: 10 15 | total neighbor size: 0 16 | total query time: 0.0 17 | average neighbor size: NaN 18 | average query time: NaN 19 | -------------------------------------------------------------------------------- /benchmark/neptune/result/8xlarge-KN-latency-Graph500-1: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 3600312, 723, 221 3 | 2677094, 82, 4 4 | 2038005, 257, 4 5 | 3301167, 2691, 9 6 | 704219, 7, 3 7 | 1779962, 669, 5 8 | 2681401, 8532, 19 9 | 2277366, 809, 5 10 | 1649130, 967, 5 11 | 806220, 2101, 7 12 | 3783689, 868, 5 13 | 3979771, 23306, 47 14 | 2878950, 2397, 8 15 | 1316789, 91, 3 16 | 4099483, 158, 3 17 | 2654216, 2935, 8 18 | 3520283, 68, 3 19 | 320529, 940, 5 20 | 460890, 1213, 5 21 | 2861567, 18, 4 22 | 1676721, 997, 5 23 | 3582851, 61, 3 24 | 2025534, 1596, 6 25 | 1897682, 79, 3 26 | 3042164, 91, 3 27 | 683461, 8913, 19 28 | 484783, 1675, 7 29 | 2964318, 2, 3 30 | 825304, 92, 3 31 | 2303395, 22950, 45 32 | 3029190, 201, 4 33 | 2119218, 2930, 8 34 | 341236, 7391, 17 35 | 3921645, 160, 3 36 | 3350720, 11325, 24 37 | 1382338, 2624, 8 38 | 2497566, 6704, 15 39 | 2293317, 91, 3 40 | 1365818, 226, 3 41 | 3108349, 248, 3 42 | 1039487, 84, 3 43 | 656628, 1941, 6 44 | 326459, 161, 3 45 | 3486463, 838, 4 46 | 1513849, 576, 4 47 | 3120768, 26, 3 48 | 3254104, 1812, 6 49 | 2859677, 47, 3 50 | 4100533, 6961, 16 51 | 1214662, 969, 7 52 | 2844418, 2016, 7 53 | 3228461, 29, 3 54 | 2971789, 2509, 8 55 | 838862, 227, 3 56 | 3242202, 67601, 130 57 | 231946, 49, 4 58 | 103480, 1247, 5 59 | 745855, 81, 4 60 | 2202837, 542, 4 61 | 121973, 1710, 6 62 | 2944986, 5778, 14 63 | 3916778, 6272, 14 64 | 1237877, 28, 3 65 | 2404335, 189, 3 66 | 3903782, 18494, 38 67 | 3753107, 21916, 49 68 | 2638320, 8615, 19 69 | 3532534, 4484, 11 70 | 3026267, 7979, 18 71 | 149529, 2, 3 72 | 2522099, 292, 3 73 | 1565761, 2165, 7 74 | 1345848, 708, 4 75 | 1059426, 504, 4 76 | 2994540, 9118, 20 77 | 1629629, 6958, 17 78 | 1481421, 2811, 8 79 | 337894, 804, 4 80 | 2706001, 467, 23 81 | 342515, 2739, 8 82 | 2301230, 673, 4 83 | 3455722, 2248, 7 84 | 4103891, 215, 12 85 | 2560844, 2114, 7 86 | 316796, 885, 5 87 | 3853684, 173, 3 88 | 2803721, 525, 4 89 | 2782143, 60, 3 90 | 4168065, 98, 3 91 | 1297201, 247, 3 92 | 2982970, 163501, 322 93 | 1089600, 2349, 9 94 | 3589606, 28, 3 95 | 1978189, 2700, 8 96 | 514482, 1430, 5 97 | 773765, 65, 3 98 | 1929789, 73, 3 99 | 2499474, 25325, 52 100 | 1367644, 2763, 8 101 | 3052548, 2991, 8 102 | 2020748, 611, 4 103 | 1934532, 296, 3 104 | 2595851, 1227, 7 105 | 1265635, 682, 4 106 | 2678981, 147, 4 107 | 3484689, 709, 4 108 | 2778764, 270, 3 109 | 323958, 883, 4 110 | 1972929, 2, 13 111 | 2529296, 6922, 16 112 | 2638682, 102, 3 113 | 2836761, 736, 4 114 | 3489646, 24586, 49 115 | 2304697, 25538, 54 116 | 3006908, 53, 4 117 | 3976118, 8280, 19 118 | 432800, 133, 3 119 | 3408347, 805, 4 120 | 3184190, 57, 3 121 | 2478197, 98, 3 122 | 3990575, 986, 5 123 | 3097880, 13, 3 124 | 259436, 2841, 8 125 | 479595, 44, 3 126 | 2054949, 20, 3 127 | 1014166, 36, 3 128 | 2398658, 695, 4 129 | 3499821, 8717, 19 130 | 289302, 25637, 52 131 | 2689848, 769, 7 132 | 603652, 264, 4 133 | 2764479, 712, 4 134 | 3458769, 250, 3 135 | 2372488, 14, 3 136 | 3826201, 94, 3 137 | 610619, 7341, 16 138 | 1502380, 623, 4 139 | 1417031, 8246, 18 140 | 1291296, 67379, 131 141 | 1699680, 834, 5 142 | 1816799, 22, 3 143 | 2952048, 25084, 50 144 | 3747093, 68, 3 145 | 996609, 846, 4 146 | 1906969, 141, 3 147 | 712790, 25261, 51 148 | 1973404, 22, 3 149 | 2874441, 198, 3 150 | 4072076, 216, 3 151 | 534367, 18, 3 152 | 2419131, 11375, 24 153 | 3145715, 213, 3 154 | 1172458, 838, 4 155 | 2547240, 1929, 6 156 | 579284, 2917, 8 157 | 3952328, 6, 6 158 | 3217974, 6340, 15 159 | 928922, 2583, 7 160 | 2975442, 421, 3 161 | 3686619, 99, 3 162 | 143324, 101, 3 163 | 2262470, 1235, 5 164 | 2844253, 210, 3 165 | 3960743, 34, 3 166 | 95176, 27, 3 167 | 2661831, 62, 3 168 | 289798, 7961, 17 169 | 498881, 1364, 5 170 | 459455, 29, 3 171 | 3778765, 25507, 51 172 | 2575099, 315, 4 173 | 2321106, 20273, 41 174 | 898887, 8936, 20 175 | 1630163, 2254, 7 176 | 3268706, 270, 3 177 | 25081, 230, 3 178 | 3747551, 915, 4 179 | 2048028, 699, 4 180 | 1377545, 7796, 17 181 | 2178454, 25231, 50 182 | 3666746, 463, 4 183 | 1692598, 213, 3 184 | 1809240, 29, 2 185 | 1461949, 984, 4 186 | 3878592, 306, 3 187 | 96570, 572, 4 188 | 4095479, 7461, 17 189 | 2539031, 328, 3 190 | 364055, 2880, 8 191 | 3514283, 8739, 18 192 | 3843398, 667, 4 193 | 3556803, 338, 3 194 | 2592596, 2779, 8 195 | 168, 2978, 8 196 | 2336570, 58, 3 197 | 327991, 2664, 8 198 | 2445956, 7478, 17 199 | 1140337, 22973, 45 200 | 2663510, 65106, 128 201 | 2514997, 756, 5 202 | 1933620, 9066, 19 203 | 1076164, 8471, 19 204 | 3734798, 66, 3 205 | 99836, 823, 4 206 | 2404509, 2413, 7 207 | 3102298, 80, 3 208 | 2158818, 9068, 19 209 | 3088473, 15, 3 210 | 3861233, 204, 3 211 | 1453810, 4, 2 212 | 1952126, 373, 3 213 | 968226, 2213, 15 214 | 594138, 2274, 8 215 | 1059034, 823, 4 216 | 408333, 13, 3 217 | 3246311, 10, 3 218 | 587844, 1855, 6 219 | 1602562, 174, 3 220 | 2546319, 8471, 18 221 | 2861944, 898, 4 222 | 1360827, 67265, 131 223 | 1915610, 4392, 11 224 | 957424, 3181, 9 225 | 1427107, 53, 3 226 | 433135, 88, 9 227 | 3353932, 628, 4 228 | 140407, 863, 4 229 | 1989222, 753, 4 230 | 1392471, 23602, 47 231 | 1290284, 8027, 18 232 | 2144691, 18311, 37 233 | 1299024, 44, 3 234 | 764990, 880, 4 235 | 302910, 1225, 5 236 | 4192735, 829, 4 237 | 3181076, 658, 4 238 | 1535127, 2818, 12 239 | 263980, 1690, 6 240 | 1571976, 924, 4 241 | 2271738, 1766, 10 242 | 492328, 1615, 5 243 | 3976408, 216, 3 244 | 1621372, 731, 4 245 | 3024237, 90, 3 246 | 3229179, 62056, 123 247 | 2167063, 24706, 49 248 | 102878, 2920, 8 249 | 4085765, 756, 4 250 | 2370758, 92, 3 251 | 2987431, 24070, 48 252 | 2633916, 240, 3 253 | 1177859, 25586, 50 254 | 1581601, 8960, 19 255 | 18147, 2839, 14 256 | 697579, 137, 3 257 | 3491436, 2932, 9 258 | 699069, 472, 4 259 | 1608362, 721, 4 260 | 2570730, 2772, 8 261 | 3929663, 21812, 44 262 | 1304943, 1491, 5 263 | 3733946, 6672, 15 264 | 2216412, 8577, 19 265 | 3013035, 26, 3 266 | 261001, 125, 3 267 | 32290, 23475, 46 268 | 113329, 8993, 19 269 | 1509856, 8320, 18 270 | 2190260, 515, 3 271 | 3103760, 866, 4 272 | 3687843, 2456, 7 273 | 1245035, 3, 2 274 | 3341532, 1724, 6 275 | 857395, 1702, 5 276 | 3942814, 3232, 8 277 | 3982809, 318, 3 278 | 2807038, 2806, 8 279 | 3291942, 242, 3 280 | 1840809, 3154, 8 281 | 760204, 47, 2 282 | 3108890, 4, 2 283 | 1416278, 53, 3 284 | 3725922, 25513, 51 285 | 2189358, 2842, 8 286 | 2810970, 359, 3 287 | 655805, 287, 3 288 | 63077, 2172, 6 289 | 3708992, 8508, 18 290 | 2622204, 31, 3 291 | 1647516, 529, 4 292 | 1274701, 511, 3 293 | 2238470, 1118, 4 294 | 83658, 928, 4 295 | 3800740, 6111, 14 296 | 3659055, 921, 4 297 | 740181, 2691, 7 298 | 318596, 18172, 36 299 | 1353213, 641, 4 300 | 3058396, 275, 3 301 | 3497001, 212, 3 302 | ==================================================== 303 | number of start vertex: 300 304 | number of query didn't finish correctly: 0 305 | total neighbor size: 1538526 306 | total query time: 4040.0 307 | average neighbor size: 5128.42 308 | average query time: 13.466666666666667 309 | -------------------------------------------------------------------------------- /benchmark/neptune/result/8xlarge-KN-latency-Graph500-3: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 3600312, -1, -1 3 | 2677094, 285633, 4441 4 | 2038005, -1, -1 5 | 3301167, -1, -1 6 | 704219, 26549, 93 7 | 1779962, -1, -1 8 | 2681401, -1, -1 9 | 2277366, -1, -1 10 | 1649130, -1, -1 11 | 806220, -1, -1 12 | ==================================================== 13 | number of start vertex: 10 14 | number of query didn't finish correctly: 8 15 | total neighbor size: 312182 16 | total query time: 4534.0 17 | average neighbor size: 156091.0 18 | average query time: 2267.0 19 | -------------------------------------------------------------------------------- /benchmark/neptune/result/8xlarge-KN-latency-Graph500-6: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 3600312, -1, -1 3 | 2677094, -1, -1 4 | 2038005, -1, -1 5 | 3301167, -1, -1 6 | 704219, -1, -1 7 | 1779962, -1, -1 8 | 2681401, -1, -1 9 | 2277366, -1, -1 10 | 1649130, -1, -1 11 | 806220, -1, -1 12 | ==================================================== 13 | number of start vertex: 10 14 | number of query didn't finish correctly: 10 15 | total neighbor size: 0 16 | total query time: 0.0 17 | average neighbor size: NaN 18 | average query time: NaN 19 | -------------------------------------------------------------------------------- /benchmark/neptune/result/8xlarge-KN-latency-Twitter-3: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 20727483, -1, -1 3 | 50329304, -1, -1 4 | 26199460, -1, -1 5 | 1177521, -1, -1 6 | 27960125, 2022164, 38746 7 | 30440025, -1, -1 8 | 15833920, -1, -1 9 | 15015183, -1, -1 10 | 33153097, -1, -1 11 | 21250581, -1, -1 12 | ==================================================== 13 | number of start vertex: 10 14 | number of query didn't finish correctly: 9 15 | total neighbor size: 2022164 16 | total query time: 38746.0 17 | average neighbor size: 2022164.0 18 | average query time: 38746.0 19 | -------------------------------------------------------------------------------- /benchmark/neptune/result/8xlarge-KN-latency-Twitter-6: -------------------------------------------------------------------------------- 1 | start vertex, neighbor size, query time (in ms) 2 | 20727483, -1, -1 3 | 50329304, -1, -1 4 | 26199460, -1, -1 5 | 1177521, -1, -1 6 | 27960125, -1, -1 7 | 30440025, -1, -1 8 | 15833920, -1, -1 9 | 15015183, -1, -1 10 | 33153097, -1, -1 11 | 21250581, -1, -1 12 | ==================================================== 13 | number of start vertex: 10 14 | number of query didn't finish correctly: 10 15 | total neighbor size: 0 16 | total query time: 0.0 17 | average neighbor size: NaN 18 | average query time: NaN 19 | -------------------------------------------------------------------------------- /benchmark/neptune/twitter_rv.net-seed: -------------------------------------------------------------------------------- 1 | 20727483 50329304 26199460 1177521 27960125 30440025 15833920 15015183 33153097 21250581 28548532 42860945 22171728 15254388 44713775 44868770 16350915 33650477 56847735 18056455 32831346 56969867 73483 24981801 25726723 59109778 18381650 8467712 29781057 37886317 39357186 42520611 28471398 1288371 44112249 29088897 15568898 25038085 14075928 96 31835375 22480457 27104736 22687463 27576832 108 35792763 21373148 15234546 14379717 42744015 16927373 16727535 51520097 15078404 14199173 4517721 17323985 18218033 21828142 52674447 15285305 45827167 50826077 54064328 6941 33586608 204 22716284 34386420 36187082 31239408 40316879 10667662 46517052 24523660 14521821 18548221 41496166 27104314 27654423 1685871 23184686 23994973 60312372 8610562 38978212 19740592 18803424 30395784 35908081 21156271 20530182 23378124 29830423 44304625 28830907 31180323 17998925 46822485 42240052 45193938 53758197 20460235 52923055 16129920 15214045 19109927 15917338 27457788 38631864 50808075 19130449 11015592 24777262 14127710 28570061 29941438 15423869 20804997 22667467 26589987 45114047 18087450 961081 14231321 14050138 22742142 36412963 6444062 41608888 15492329 19632867 20194683 22286431 27558050 5120691 48570598 48459607 38407885 23686306 44807976 17129374 1775731 17872794 54491514 18812795 37479006 22281042 26116046 20841950 30244121 14854462 618593 19644074 15735493 43283406 24800750 22872869 20067354 15247448 20912620 20590051 14137268 20143330 18112970 17100967 16732759 54466171 52802702 20373034 32765375 24812106 11894652 51370393 3943871 53469420 14761795 365 46304581 3032431 20977546 21099347 42399917 796766 8909522 16460768 9121432 17919972 56643711 19226267 13221862 41259823 28466425 31806999 759251 59550897 22422221 14662772 15935591 36072333 14669432 14235317 46587124 33497221 41173269 14462907 15922433 22046932 8069572 17073811 19571299 23922282 37975089 71123 13141932 26784273 11172992 23718349 43097584 19829645 25365536 41213114 15683302 19867432 27923061 20536157 14610275 32959253 1045141 39940849 26591593 14293310 26149262 37889798 14803170 16548466 761393 17626181 1418 16609515 32629211 20534044 16797810 30096883 22508419 19124463 42532346 492 16278934 22787048 15163466 22382980 16557588 36880563 43146251 30859015 41716439 6102302 25555552 33370227 43251483 32209489 17910878 23742760 18979962 14230524 24608680 26643090 18659533 39616562 50848585 22359310 18954559 37440908 45251595 45830702 29861887 2884771 25941311 46484827 21407335 14987704 57721125 572 16350844 40926141 54916719 23511857 25515549 18591276 21035409 19923144 16841186 18583722 28335791 2557521 41470461 23006794 16418966 -------------------------------------------------------------------------------- /benchmark/neptune/upload.sh: -------------------------------------------------------------------------------- 1 | # this script use to upload data from client EC2 to S3 2 | # $1 is the argument of path/to/local/file 3 | # $2 is the argument of entire path of a file, including the file name 4 | # "bucket-name" (need to modify): is your bucket-name in S3 5 | 6 | aws s3 cp $1 s3://bucket-name/$2 7 | -------------------------------------------------------------------------------- /benchmark/tigergraph/ExprFunctions.hpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (c) 2015-2016, TigerGraph Inc. 3 | * All rights reserved. 4 | * Project: TigerGraph Query Language 5 | * udf.hpp: a library of user defined functions used in queries. 6 | * 7 | * - This library should only define functions that will be used in 8 | * TigerGraph Query scripts. Other logics, such as structs and helper 9 | * functions that will not be directly called in the GQuery scripts, 10 | * must be put into "ExprUtil.hpp" under the same directory where 11 | * this file is located. 12 | * 13 | * - Supported type of return value and parameters 14 | * - int 15 | * - float 16 | * - double 17 | * - bool 18 | * - string (don't use std::string) 19 | * - accumulators 20 | * 21 | * - Function names are case sensitive, unique, and can't be conflict with 22 | * built-in math functions and reserve keywords. 23 | * 24 | * - Please don't remove necessary codes in this file 25 | * 26 | * - A backup of this file can be retrieved at 27 | * /dev_/gdk/gsql/src/QueryUdf/ExprFunctions.hpp 28 | * after upgrading the system. 29 | * 30 | ******************************************************************************/ 31 | 32 | #ifndef EXPRFUNCTIONS_HPP_ 33 | #define EXPRFUNCTIONS_HPP_ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | /** XXX Warning!! Put self-defined struct in ExprUtil.hpp ** 41 | * No user defined struct, helper functions (that will not be directly called 42 | * in the GQuery scripts) etc. are allowed in this file. This file only 43 | * contains user-defined expression function's signature and body. 44 | * Please put user defined structs, helper functions etc. in ExprUtil.hpp 45 | */ 46 | #include "ExprUtil.hpp" 47 | 48 | namespace UDIMPL { 49 | typedef std::string string; //XXX DON'T REMOVE 50 | 51 | /****** BIULT-IN FUNCTIONS **************/ 52 | /****** XXX DON'T REMOVE ****************/ 53 | inline int str_to_int (string str) { 54 | return atoi(str.c_str()); 55 | } 56 | 57 | inline int float_to_int (float val) { 58 | return (int) val; 59 | } 60 | 61 | inline string to_string (double val) { 62 | char result[200]; 63 | sprintf(result, "%g", val); 64 | return string(result); 65 | } 66 | 67 | inline int64_t uid_to_vid(VERTEX val){ 68 | return val; 69 | } 70 | } 71 | /****************************************/ 72 | 73 | #endif /* EXPRFUNCTIONS_HPP_ */ 74 | -------------------------------------------------------------------------------- /benchmark/tigergraph/benchmark-graph500.sh: -------------------------------------------------------------------------------- 1 | nohup python kn.py $1/graph500-22-seed 300 tigergraph 1 notes latency; nohup python kn.py $1/graph500-22-seed 300 tigergraph 2 notes latency; nohup python kn.py $1/graph500-22-seed 10 tigergraph 3 notes latency; nohup python kn.py $1/graph500-22-seed 10 tigergraph 6 notes latency; nohup python wcc.py graph500-22 tigergraph 3;nohup python pg.py graph500-22 tigergraph 10 3 2 | -------------------------------------------------------------------------------- /benchmark/tigergraph/benchmark-twitter.sh: -------------------------------------------------------------------------------- 1 | nohup python kn.py $1/twitter_rv.net-seed 300 tigergraph 1 notes latency; nohup python kn.py $1/twitter_rv.net-seed 300 tigergraph 2 notes latency; nohup python kn.py $1/twitter_rv.net-seed 10 tigergraph 3 notes latency; nohup python kn.py $1/twitter_rv.net-seed 10 tigergraph 6 notes latency; nohup python wcc.py twitter-rv tigergraph 3;python pg.py twitter-rv tigergraph 10 3 2 | -------------------------------------------------------------------------------- /benchmark/tigergraph/cluster_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "tigergraph.user.name": "tigergraph", 3 | "tigergraph.user.password": "tigergraph", 4 | "tigergraph.root.dir": "/ebs/install/", 5 | "license.key": "4cf99c76aa0e331b9477c635bc5c5a429f5915357578972761528a9335fe3d49654d9dca99f9f65989625f7e26d12ca840cd450081c0323bc9780ceaaa77a3d5b7846d7c5603cc", 6 | "nodes.ip": { 7 | "m1":"18.206.164.89", 8 | "m2": "54.197.15.228", 9 | "m3": "18.207.223.109", 10 | "m4": "54.174.44.39", 11 | "m5": "54.86.142.246", 12 | "m6": "18.206.114.106" 13 | }, 14 | "nodes.login": { 15 | "supported.methods (this is a comment)": "P. SSH with password; K. SSH with key file (e.g. ec2_key.pem)", 16 | "notes (this is a comment)": "All nodes must use the same sudo user, same password, or same key file", 17 | "chosen.method": "K", 18 | "P": { 19 | "sudo.user.name": "sudoUserName", 20 | "sudo.user.password": "sudoUserPassword" 21 | }, 22 | "K": { 23 | "sudo.user.name": "ubuntu", 24 | "ssh.key.file": "/home/ubuntu/qa_release" 25 | } 26 | }, 27 | "HA.option": { 28 | "Notes of HA.option (this is a comment)": "option to install high-availability cluster (with at least 3 nodes), default value false", 29 | "enable.HA": "false (or true)" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /benchmark/tigergraph/config.py: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | 10 | import os 11 | 12 | NEO4J_BOLT= os.environ.get("NEO4J_BOLT", "bolt://127.0.0.1:7687") 13 | TIGERGRAPH_HTTP = os.environ.get("TIGERGRAPH_HTTP", "http://127.0.0.1:9000") 14 | -------------------------------------------------------------------------------- /benchmark/tigergraph/graph500-22-seed: -------------------------------------------------------------------------------- 1 | 3600312 2677094 2038005 3301167 704219 1779962 2681401 2277366 1649130 806220 3783689 3979771 2878950 1316789 4099483 2654216 3520283 320529 460890 2861567 1676721 3582851 2025534 1897682 3042164 683461 484783 2964318 825304 2303395 3029190 2119218 341236 3921645 3350720 1382338 2497566 2293317 1365818 3108349 1039487 656628 326459 3486463 1513849 3120768 3254104 2859677 4100533 1214662 2844418 3228461 2971789 838862 3242202 231946 103480 745855 2202837 121973 2944986 3916778 1237877 2404335 3903782 3753107 2638320 3532534 3026267 149529 2522099 1565761 1345848 1059426 2994540 1629629 1481421 337894 2706001 342515 2301230 3455722 4103891 2560844 316796 3853684 2803721 2782143 4168065 1297201 2982970 1089600 3589606 1978189 514482 773765 1929789 2499474 1367644 3052548 2020748 1934532 2595851 1265635 2678981 3484689 2778764 323958 1972929 2529296 2638682 2836761 3489646 2304697 3006908 3976118 432800 3408347 3184190 2478197 3990575 3097880 259436 479595 2054949 1014166 2398658 3499821 289302 2689848 603652 2764479 3458769 2372488 3826201 610619 1502380 1417031 1291296 1699680 1816799 2952048 3747093 996609 1906969 712790 1973404 2874441 4072076 534367 2419131 3145715 1172458 2547240 579284 3952328 3217974 928922 2975442 3686619 143324 2262470 2844253 3960743 95176 2661831 289798 498881 459455 3778765 2575099 2321106 898887 1630163 3268706 25081 3747551 2048028 1377545 2178454 3666746 1692598 1809240 1461949 3878592 96570 4095479 2539031 364055 3514283 3843398 3556803 2592596 168 2336570 327991 2445956 1140337 2663510 2514997 1933620 1076164 3734798 99836 2404509 3102298 2158818 3088473 3861233 1453810 1952126 968226 594138 1059034 408333 3246311 587844 1602562 2546319 2861944 1360827 1915610 957424 1427107 433135 3353932 140407 1989222 1392471 1290284 2144691 1299024 764990 302910 4192735 3181076 1535127 263980 1571976 2271738 492328 3976408 1621372 3024237 3229179 2167063 102878 4085765 2370758 2987431 2633916 1177859 1581601 18147 697579 3491436 699069 1608362 2570730 3929663 1304943 3733946 2216412 3013035 261001 32290 113329 1509856 2190260 3103760 3687843 1245035 3341532 857395 3942814 3982809 2807038 3291942 1840809 760204 3108890 1416278 3725922 2189358 2810970 655805 63077 3708992 2622204 1647516 1274701 2238470 83658 3800740 3659055 740181 318596 1353213 3058396 3497001 -------------------------------------------------------------------------------- /benchmark/tigergraph/graph500_setup.gsql: -------------------------------------------------------------------------------- 1 | drop all 2 | 3 | create vertex MyNode (primary_id id string) 4 | create directed edge MyEdge(from MyNode, to MyNode) 5 | create graph graph500(MyNode, MyEdge) 6 | 7 | USE GRAPH graph500 8 | CREATE LOADING JOB load_graph500_edge FOR GRAPH graph500 { 9 | DEFINE FILENAME file1; 10 | 11 | LOAD file1 12 | TO EDGE MyEdge VALUES ($0, $1) USING header="false", separator="\t"; 13 | } 14 | 15 | 16 | @kn-graph500.gsql 17 | @wcc-graph500.gsql 18 | @pg-graph500.gsql 19 | 20 | install query all 21 | -------------------------------------------------------------------------------- /benchmark/tigergraph/khop.gsql: -------------------------------------------------------------------------------- 1 | # return the exact k-hop neighbors count. If a vertex have a path of less 2 | # than k-hop from the input vertex, we won't count it as k-hop neighbor 3 | CREATE QUERY khop(VERTEX start_node, INT depth) for graph graph500{ 4 | 5 | OrAccum @visited = false; 6 | SumAccum @@loop=0; 7 | 8 | Start = {start_node}; 9 | Start = SELECT v 10 | FROM Start:v 11 | ACCUM v.@visited = true; 12 | 13 | WHILE (@@loop < depth) DO 14 | Start = SELECT v 15 | FROM Start:u - (MyEdge:e)->:v 16 | WHERE v.@visited == false 17 | POST-ACCUM v.@visited = true; 18 | 19 | @@loop += 1; 20 | END; 21 | 22 | PRINT Start.size(); 23 | } 24 | -------------------------------------------------------------------------------- /benchmark/tigergraph/kn-graph500.gsql: -------------------------------------------------------------------------------- 1 | # return the k-hop neighbors count. 2 | CREATE QUERY khop(VERTEX start_node, INT depth) for graph graph500{ 3 | 4 | int i = 0; 5 | 6 | Start = {start_node}; 7 | 8 | WHILE (i < depth) DO 9 | Start = SELECT v 10 | FROM Start:u - (MyEdge:e)->:v; 11 | i = i + 1; 12 | END; 13 | 14 | PRINT Start.size(); 15 | } 16 | -------------------------------------------------------------------------------- /benchmark/tigergraph/kn-twitter.gsql: -------------------------------------------------------------------------------- 1 | # return the k-hop neighbors count. 2 | CREATE QUERY khop(VERTEX start_node, INT depth) for graph twitter{ 3 | 4 | int i = 0; 5 | 6 | Start = {start_node}; 7 | 8 | WHILE (i < depth) DO 9 | Start = SELECT v 10 | FROM Start:u - (MyEdge:e)->:v; 11 | i = i + 1; 12 | END; 13 | 14 | PRINT Start.size(); 15 | } 16 | -------------------------------------------------------------------------------- /benchmark/tigergraph/pg-graph500.gsql: -------------------------------------------------------------------------------- 1 | use graph graph500 2 | 3 | drop query pagerank 4 | 5 | CREATE QUERY pagerank (int iteration, float dampingFactor) 6 | FOR GRAPH graph500 7 | { 8 | # In each iteration, compute a score for each vertex: 9 | # score = dampingFactor + (1-dampingFactor)* sum(received scores from its neighbors). 10 | # The pageRank algorithm stops after running iteration iterations 11 | # This implementation is based on https://graphsql.atlassian.net/wiki/display/UGH/Query+Example%3A+PageRank 12 | # To only measure the execution time, we do not print a large number of results. only the max difference is returned 13 | 14 | MaxAccum @@maxDifference = 3.1415926; 15 | SumAccum @received_score = 0; # sum of scores each vertex receives from neighbors 16 | SumAccum @score = 1; # initial score for every vertex is 1. 17 | 18 | AllV = {MyNode.*}; # Start with all vertices of type Page 19 | WHILE TRUE LIMIT iteration DO 20 | #@@maxDifference = 0; 21 | AllV = SELECT s 22 | FROM AllV:s-(MyEdge)->:t 23 | ACCUM t.@received_score += s.@score/s.outdegree() 24 | POST-ACCUM t.@score = dampingFactor + (1-dampingFactor) * t.@received_score, 25 | t.@received_score = 0; 26 | #@@maxDifference += abs(t.@score - t.@score'); 27 | END; # end while loop 28 | PRINT @@maxDifference; # print the results 29 | } # end query 30 | 31 | 32 | -------------------------------------------------------------------------------- /benchmark/tigergraph/pg-twitter-distributed.gsql: -------------------------------------------------------------------------------- 1 | use graph twitter 2 | 3 | drop query pagerank 4 | 5 | CREATE DISTRIBUTED QUERY pagerank (int iteration, float dampingFactor) 6 | FOR GRAPH twitter 7 | { 8 | # In each iteration, compute a score for each vertex: 9 | # score = dampingFactor + (1-dampingFactor)* sum(received scores from its neighbors). 10 | # The pageRank algorithm stops after running iteration iterations 11 | # This implementation is based on https://graphsql.atlassian.net/wiki/display/UGH/Query+Example%3A+PageRank 12 | # To only measure the execution time, we do not print a large number of results. only the max difference is returned 13 | 14 | MaxAccum @@maxDifference = 3.1415926; 15 | SumAccum @received_score = 0; # sum of scores each vertex receives from neighbors 16 | SumAccum @score = 1; # initial score for every vertex is 1. 17 | 18 | AllV = {MyNode.*}; # Start with all vertices of type Page 19 | WHILE TRUE LIMIT iteration DO 20 | #@@maxDifference = 0; 21 | AllV = SELECT s 22 | FROM AllV:s-(MyEdge)->:t 23 | ACCUM t.@received_score += s.@score/s.outdegree() 24 | POST-ACCUM t.@score = dampingFactor + (1-dampingFactor) * t.@received_score, 25 | t.@received_score = 0; 26 | #@@maxDifference += abs(t.@score - t.@score'); 27 | END; # end while loop 28 | PRINT @@maxDifference; # print the results 29 | } # end query 30 | 31 | install query pagerank 32 | -------------------------------------------------------------------------------- /benchmark/tigergraph/pg-twitter.gsql: -------------------------------------------------------------------------------- 1 | use graph twitter 2 | 3 | drop query pagerank 4 | 5 | CREATE QUERY pagerank (int iteration, float dampingFactor) 6 | FOR GRAPH twitter 7 | { 8 | # In each iteration, compute a score for each vertex: 9 | # score = dampingFactor + (1-dampingFactor)* sum(received scores from its neighbors). 10 | # The pageRank algorithm stops after running iteration iterations 11 | # This implementation is based on https://graphsql.atlassian.net/wiki/display/UGH/Query+Example%3A+PageRank 12 | # To only measure the execution time, we do not print a large number of results. only the max difference is returned 13 | 14 | MaxAccum @@maxDifference = 3.1415926; 15 | SumAccum @received_score = 0; # sum of scores each vertex receives from neighbors 16 | SumAccum @score = 1; # initial score for every vertex is 1. 17 | 18 | AllV = {MyNode.*}; # Start with all vertices of type Page 19 | WHILE TRUE LIMIT iteration DO 20 | #@@maxDifference = 0; 21 | AllV = SELECT s 22 | FROM AllV:s-(MyEdge)->:t 23 | ACCUM t.@received_score += s.@score/s.outdegree() 24 | POST-ACCUM t.@score = dampingFactor + (1-dampingFactor) * t.@received_score, 25 | t.@received_score = 0; 26 | #@@maxDifference += abs(t.@score - t.@score'); 27 | END; # end while loop 28 | PRINT @@maxDifference; # print the results 29 | } # end query 30 | -------------------------------------------------------------------------------- /benchmark/tigergraph/pg.py: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | 10 | import random 11 | import sys 12 | import os 13 | import datetime 14 | from timeit import default_timer as timer 15 | 16 | from query_runner import * 17 | from config import * 18 | 19 | 20 | ########################################################### 21 | # PageRank benchmark 22 | ########################################################### 23 | 24 | def RunPG(filename, db_name, num_iteration, num_tests, notes = ""): 25 | """ 26 | #test,num_iteration,time 27 | ... 28 | summary,num_iteration,average_time 29 | """ 30 | #create result folder 31 | if not os.path.exists(os.path.dirname("./result/")): 32 | try: 33 | os.makedirs(os.path.dirname("./result/")) 34 | except OSError as exc: # Guard against race condition 35 | if exc.errno != errno.EEXIST: 36 | raise 37 | 38 | ofile = open("result/PG-latency-" + db_name + "-" + filename, 'a') 39 | if db_name == "neo4j": 40 | runner = Neo4jQueryRunner() 41 | elif db_name == "tigergraph": 42 | runner = TigerGraphQueryRunner() 43 | else: 44 | print("invalid db " + db_name) 45 | total_time = 0.0 46 | total_knsize = 0 47 | report = "\n---------- " + str(datetime.datetime.now()) + " " + notes + " ----------\n" 48 | for i in range(0, num_tests): 49 | start = timer() 50 | runner.PG(num_iteration) 51 | end = timer() 52 | exe_time = end - start 53 | total_time += exe_time 54 | line = str(i) + "," + str(num_iteration) + "," + str(exe_time) + " seconds" 55 | print(line) 56 | report += line + "\n" 57 | report += "summary," + str(num_iteration) + "," + str(total_time/num_tests) + " seconds" 58 | ofile.write(report) 59 | print (report) 60 | 61 | 62 | if __name__ == "__main__": 63 | # kn.py file_name db_name num_iteration 64 | if len(sys.argv) < 5: 65 | print("Usage: python pg.py raw_file_name db_name num_iteration num_tests") 66 | sys.exit() 67 | # python pg.py graph500-22 neo4j 1 2 68 | RunPG(os.path.basename(sys.argv[1]), sys.argv[2], int(sys.argv[3]), int(sys.argv[4]), sys.argv[5] if len(sys.argv) == 6 else "") 69 | -------------------------------------------------------------------------------- /benchmark/tigergraph/query_runner.py: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | 10 | import requests 11 | 12 | from neo4j.v1 import GraphDatabase, basic_auth 13 | 14 | import config 15 | 16 | class QueryRunner(): 17 | def __init__(self): 18 | pass 19 | 20 | def KN(self, root): 21 | pass 22 | 23 | def SSSP(self, root): 24 | pass 25 | 26 | def PG(self): 27 | pass 28 | 29 | def WCC(self): 30 | pass 31 | 32 | def LCC(self): 33 | pass 34 | 35 | 36 | 37 | class Neo4jQueryRunner(QueryRunner): 38 | def __init__(self, url = config.NEO4J_BOLT): 39 | QueryRunner.__init__(self) 40 | self.driver = GraphDatabase.driver(url, auth=basic_auth("neo4j", "benchmark")) 41 | self.session = self.driver.session() 42 | 43 | def KN(self, root, depth): 44 | 45 | try: 46 | # a path of length depth, if a node is 1-hop away, and also 2-hop away, we count it in 2-hop set. 47 | result = self.session.run("match (n1:MyNode)-[:MyEdge*" + str(depth) + "]->(n2:MyNode) where n1.id={root} return count(distinct n2)", {"root":root}) 48 | record = result.peek() 49 | except: #timeout, we return -1, reset session 50 | self.session.close() 51 | self.session = self.driver.session() 52 | return -1 53 | else: 54 | return record["count(distinct n2)"] 55 | 56 | def PG(self, iteration): 57 | result = self.session.run("MATCH (node:MyNode) WITH COLLECT(node) AS nodes CALL apoc.algo.pageRankWithConfig(nodes,{iterations:{iteration}}) YIELD node, score RETURN node, score LIMIT 1", {"iteration":iteration}) 58 | record = result.peek() 59 | return record 60 | 61 | def WCC(self): 62 | result = self.session.run("CALL apoc.algo.wcc() yield stats return count(*)") 63 | record = result.peek() 64 | return record 65 | 66 | #build index 67 | def Index(self, att, typename): 68 | result = self.session.run("CREATE INDEX ON :{typename}({att});", {"typename":typename, "att":att}) 69 | 70 | record = result.peek() 71 | 72 | 73 | class TigerGraphQueryRunner(QueryRunner): 74 | def __init__(self, url = config.TIGERGRAPH_HTTP): 75 | QueryRunner.__init__(self) 76 | self.session = requests.Session() 77 | self.url = url 78 | 79 | def KN(self, root, depth): 80 | result = self.session.get(self.url + "/query/khop", params={'start_node': root, "depth":depth}).json() 81 | return result["results"][0]["Start.size()"] 82 | 83 | def PG(self, iteration): 84 | result = self.session.get(self.url + "/query/pagerank", params={'iteration': iteration, "dampingFactor":0.8}).json() 85 | print (result) 86 | 87 | def WCC(self): 88 | result = self.session.get(self.url + "/query/wcc").json() 89 | print (result) 90 | 91 | if __name__ == "__main__": 92 | runner = TigerGraphQueryRunner() 93 | runner.PG(100) 94 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/KN-latency-tigergraph-graph500-22-seed-k3: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-03 01:03:08.958853 notes ---------- 3 | 3600312,1519273,0.3583660999993299 4 | 2677094,285633,0.035454414999549044 5 | 2038005,1553376,0.29162152800017793 6 | 3301167,2018348,0.688205704000211 7 | 704219,26549,0.005433368998637889 8 | 1779962,1520027,0.359747315000277 9 | 2681401,2075644,0.8719635010002094 10 | 2277366,1682414,0.4123590310009604 11 | 1649130,2099589,0.7169666129993857 12 | 806220,1532485,0.38670097700014594 13 | summary, avg knsize=1431333.8, avg query time=0.41268185529988843s, timeout query cnt=0 14 | ---------- 2018-08-03 01:06:24.060371 notes ---------- 15 | 3600312,1519273,0.3431041939984425 16 | 2677094,285633,0.03491846399992937 17 | 2038005,1553376,0.31855251799970574 18 | 3301167,2018348,0.7190798150004412 19 | 704219,26549,0.007215773999632802 20 | 1779962,1520027,0.3379047760008689 21 | 2681401,2075644,0.841522310000073 22 | 2277366,1682414,0.41635673599921574 23 | 1649130,2099589,0.7456080940009997 24 | 806220,1532485,0.36118898700078717 25 | summary, avg knsize=1431333.8, avg query time=0.41254516680000963s, timeout query cnt=0 -------------------------------------------------------------------------------- /benchmark/tigergraph/result/KN-latency-tigergraph-graph500-22-seed-k6: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-03 01:03:13.316820 notes ---------- 3 | 3600312,1646710,1.5940972759999568 4 | 2677094,510565,0.21425611800077604 5 | 2038005,1814714,1.8191985700013902 6 | 3301167,2060740,2.8174617740005488 7 | 704219,392439,0.1106888069989509 8 | 1779962,1639009,1.6069996149999497 9 | 2681401,2091360,3.2166316010006994 10 | 2277366,1817352,1.9442815330003214 11 | 1649130,2148928,3.238904312998784 12 | 806220,1628381,1.5711287150006683 13 | summary, avg knsize=1575019.8, avg query time=1.8133648322002045s, timeout query cnt=0 14 | ---------- 2018-08-03 01:06:28.394039 notes ---------- 15 | 3600312,1646710,1.576884293999683 16 | 2677094,510565,0.21159358200020506 17 | 2038005,1814714,1.8430396160001692 18 | 3301167,2060740,2.81796080300046 19 | 704219,392439,0.11081218399885984 20 | 1779962,1639009,1.604385734999596 21 | 2681401,2091360,3.0984402659996704 22 | 2277366,1817352,1.9080120039998292 23 | 1649130,2148928,3.01394495599925 24 | 806220,1628381,1.6398953099997016 25 | summary, avg knsize=1575019.8, avg query time=1.7824968749997425s, timeout query cnt=0 -------------------------------------------------------------------------------- /benchmark/tigergraph/result/KN-latency-tigergraph-twitter_rv.net-seed-k3: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-03 02:59:09.415118 notes ---------- 3 | 20727483,18098900,3.922953672999938 4 | 50329304,20303955,4.3381387749996065 5 | 26199460,27826746,12.763545586998589 6 | 1177521,28246041,12.627576654000222 7 | 27960125,2022164,0.2767468469992309 8 | 30440025,18571303,4.100359378000576 9 | 15833920,23617530,8.674491002999275 10 | 15015183,23792215,8.915457850000166 11 | 33153097,24245033,6.579075824000029 12 | 21250581,20178381,5.102748850000353 13 | summary, avg knsize=20690226.8, avg query time=6.730109444099798s, timeout query cnt=0 -------------------------------------------------------------------------------- /benchmark/tigergraph/result/KN-latency-tigergraph-twitter_rv.net-seed-k6: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-03 03:00:16.929919 notes ---------- 3 | 20727483,34988891,60.7807255409989 4 | 50329304,34993182,61.98787750599877 5 | 26199460,35008177,69.19008307100012 6 | 1177521,35008339,69.90175623399955 7 | 27960125,34904207,47.930154644998765 8 | 30440025,34989538,62.343581619999895 9 | 15833920,35002247,65.66418416899978 10 | 15015183,35002402,67.00137456299854 11 | 33153097,35002431,63.089222799999334 12 | 21250581,34996238,62.66732188400056 13 | summary, avg knsize=34989565.2, avg query time=63.05562820329942s, timeout query cnt=0 -------------------------------------------------------------------------------- /benchmark/tigergraph/result/PG-latency-tigergraph-graph500-22: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-03 01:06:55.817665 ---------- 3 | 0,10,12.527951182000834 seconds 4 | 1,10,12.570571363999989 seconds 5 | 2,10,12.450170830001298 seconds 6 | summary,10,12.51623112533404 seconds -------------------------------------------------------------------------------- /benchmark/tigergraph/result/PG-latency-tigergraph-twitter-rv: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-03 03:14:30.017855 ---------- 3 | 0,10,259.9650505060017 seconds 4 | 1,10,273.2285457649996 seconds 5 | 2,10,262.89629924399924 seconds 6 | summary,10,265.36329850500016 seconds -------------------------------------------------------------------------------- /benchmark/tigergraph/result/PG-latency-tigergraph-twitter-rv.1machine.r4.2xlarge: -------------------------------------------------------------------------------- 1 | ---------- 2018-08-14 17:46:52.709815 ---------- 2 | 0,10,957.604174137 seconds 3 | 1,10,976.277939081 seconds 4 | 2,10,975.505298138 seconds 5 | summary,10,969.795803785 seconds 6 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/PG-latency-tigergraph-twitter-rv.2machine.r4.2xlarge: -------------------------------------------------------------------------------- 1 | ---------- 2018-08-14 07:09:19.528667 ---------- 2 | 0,10,537.622447968 seconds 3 | 1,10,528.97017622 seconds 4 | 2,10,539.887454987 seconds 5 | summary,10,535.493359725 seconds 6 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/PG-latency-tigergraph-twitter-rv.4machine.r4.2xlarge: -------------------------------------------------------------------------------- 1 | ---------- 2018-08-14 05:45:52.101039 ---------- 2 | 0,10,258.166383982 seconds 3 | 1,10,265.430447102 seconds 4 | 2,10,266.543360949 seconds 5 | summary,10,263.380064011 seconds 6 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/PG-latency-tigergraph-twitter-rv.6machine.r4.2xlarge: -------------------------------------------------------------------------------- 1 | ---------- 2018-08-14 04:14:42.506544 ---------- 2 | 0,10,207.728520155 seconds 3 | 1,10,209.069442034 seconds 4 | 2,10,210.437158108 seconds 5 | summary,10,209.078373432 seconds 6 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/PG-latency-tigergraph-twitter-rv.8machine.r4.2xlarge: -------------------------------------------------------------------------------- 1 | ---------- 2018-08-14 02:40:25.659849 ---------- 2 | 0,10,148.102428913 seconds 3 | 1,10,142.068944931 seconds 4 | 2,10,144.362808943 seconds 5 | summary,10,144.844727596 seconds 6 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/WCC-latency-tigergraph-graph500-22: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-03 01:06:46.402179 ---------- 3 | 0,3.1088394609996612 4 | 1,3.039786973000446 5 | 2,3.086960710999847 6 | summary, avg time 3.078529048333318 seconds -------------------------------------------------------------------------------- /benchmark/tigergraph/result/WCC-latency-tigergraph-twitter-rv: -------------------------------------------------------------------------------- 1 | 2 | ---------- 2018-08-03 03:10:47.658429 ---------- 3 | 0,73.3527901969992 4 | 1,72.34402046399919 5 | 2,76.47819896299916 6 | summary, avg time 74.05833654133251 seconds -------------------------------------------------------------------------------- /benchmark/tigergraph/result/graph500-loading.result: -------------------------------------------------------------------------------- 1 | [Tip: Use "CTRL + C" to stop displaying the loading status update, then use "SHOW LOADING STATUS jobid" to track the loading progress again] 2 | [Tip: Manage loading jobs with "ABORT/RESUME LOADING JOB jobid"] 3 | Starting the following job, i.e. 4 | JobName: load_graph500_edge, jobid: graph500_m1.1533257716589 5 | Loading log: '/ebs/install/tigergraph/logs/restpp/restpp_loader_logs/graph500/graph500_m1.1533257716589.log' 6 | 7 | Job "graph500_m1.1533257716589" loading status 8 | [FINISHED] m1 ( Finished: 1 / Total: 1 ) 9 | [LOADED] 10 | +----------------------------------------------------------------+ 11 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 12 | |/ebs/raw/graph500-22 | 67108864 | 1198 kl/s | 55.97 s| 13 | +----------------------------------------------------------------+ 14 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/twitter-loading.1machine.r4.2xlarge: -------------------------------------------------------------------------------- 1 | ESC[2K [LOADING] /ebs/raw/twitter_rv.net 2 | ESC[2K [=================================================================================================== ] 99%, 755 kl/s 3 | ESC[4AESC[2KJob "twitter_m1.1534266308668" loading status 4 | ESC[2K[RUNNING] m1 ( Finished: 1 / Total: 1 ) 5 | ESC[2K [LOADED] 6 | ESC[2K +-------------------------------------------------------------------+ 7 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 8 | |/ebs/raw/twitter_rv.net | 1468365182 | 755 kl/s | 1944.26 s| 9 | +-------------------------------------------------------------------+ 10 | ESC[7AESC[2KJob "twitter_m1.1534266308668" loading status 11 | ESC[2K[FINISHED] m1 ( Finished: 1 / Total: 1 ) 12 | ESC[2K [LOADED] 13 | ESC[2K +-------------------------------------------------------------------+ 14 | ESC[2K | FILENAME | LOADED LINES | AVG SPEED | DURATION| 15 | ESC[2K |/ebs/raw/twitter_rv.net | 1468365182 | 755 kl/s | 1944.26 s| 16 | ESC[2K +-------------------------------------------------------------------+ 17 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/twitter-loading.2machine.r4.2xlarge: -------------------------------------------------------------------------------- 1 | ^[[13A^[[2KJob "twitter_m1.m2.1534229291046" loading status 2 | ^[[2K[FINISHED] m1 ( Finished: 1 / Total: 1 ) 3 | ^[[2K [LOADED] 4 | ^[[2K +-----------------------------------------------------------------------+ 5 | ^[[2K | FILENAME | LOADED LINES | AVG SPEED | DURATION| 6 | ^[[2K |/ebs/split/twitter_rv.net00 | 740586074 | 625 kl/s | 1183.93 s| 7 | ^[[2K +-----------------------------------------------------------------------+ 8 | ^[[2K[FINISHED] m2 ( Finished: 1 / Total: 1 ) 9 | ^[[2K [LOADED] 10 | ^[[2K +-----------------------------------------------------------------------+ 11 | ^[[2K | FILENAME | LOADED LINES | AVG SPEED | DURATION| 12 | ^[[2K |/ebs/split/twitter_rv.net01 | 727779108 | 651 kl/s | 1116.64 s| 13 | ^[[2K +-----------------------------------------------------------------------+ 14 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/twitter-loading.4machine: -------------------------------------------------------------------------------- 1 | tigergraph@ip-172-30-1-94:/ebs/ecosys/benchmark/tigergraph$ gsql -g twitter 'run loading job load_twitter_edge using file1="all:/ebs/raw/split_twitter_rv.net/"' 2 | [Tip: Use "CTRL + C" to stop displaying the loading status update, then use "SHOW LOADING STATUS jobid" to track the loading progress again] 3 | [Tip: Manage loading jobs with "ABORT/RESUME LOADING JOB jobid"] 4 | Starting the following job, i.e. 5 | JobName: load_twitter_edge, jobid: twitter_m1.m2.m3.m4.1533859139726 6 | Loading log: '/ebs/install/tigergraph/logs/restpp/restpp_loader_logs/twitter/twitter_m1.m2.m3.m4.1533859139726.log' 7 | 8 | Job "twitter_m1.m2.m3.m4.1533859139726" loading status 9 | [FINISHED] m1 ( Finished: 1 / Total: 1 ) 10 | [LOADED] 11 | +------------------------------------------------------------------------------------------+ 12 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 13 | |/ebs/raw/split_twitter_rv.net/twitter_rv.net00 | 376291808 | 1511 kl/s | 248.88 s| 14 | +------------------------------------------------------------------------------------------+ 15 | [FINISHED] m2 ( Finished: 1 / Total: 1 ) 16 | [LOADED] 17 | +------------------------------------------------------------------------------------------+ 18 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 19 | |/ebs/raw/split_twitter_rv.net/twitter_rv.net01 | 364294268 | 1507 kl/s | 241.59 s| 20 | +------------------------------------------------------------------------------------------+ 21 | [FINISHED] m3 ( Finished: 1 / Total: 1 ) 22 | [LOADED] 23 | +------------------------------------------------------------------------------------------+ 24 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 25 | |/ebs/raw/split_twitter_rv.net/twitter_rv.net02 | 363986053 | 1538 kl/s | 236.53 s| 26 | +------------------------------------------------------------------------------------------+ 27 | [FINISHED] m4 ( Finished: 1 / Total: 1 ) 28 | [LOADED] 29 | +------------------------------------------------------------------------------------------+ 30 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 31 | |/ebs/raw/split_twitter_rv.net/twitter_rv.net03 | 363793059 | 1605 kl/s | 226.64 s| 32 | +------------------------------------------------------------------------------------------+ 33 | 34 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/twitter-loading.4machine.r4.2xlarge: -------------------------------------------------------------------------------- 1 | ^[[22A^[[2KJob "twitter_m1.m2.m3.m4.1534224133425" loading status 2 | ^[[2K[FINISHED] m1 ( Finished: 1 / Total: 1 ) 3 | ^[[2K [LOADED] 4 | ^[[2K +-----------------------------------------------------------------------+ 5 | ^[[2K | FILENAME | LOADED LINES | AVG SPEED | DURATION| 6 | ^[[2K |/ebs/split/twitter_rv.net00 | 376291808 | 578 kl/s | 650.51 s| 7 | ^[[2K +-----------------------------------------------------------------------+ 8 | ^[[2K[FINISHED] m2 ( Finished: 1 / Total: 1 ) 9 | ^[[2K [LOADED] 10 | ^[[2K +-----------------------------------------------------------------------+ 11 | ^[[2K | FILENAME | LOADED LINES | AVG SPEED | DURATION| 12 | ^[[2K |/ebs/split/twitter_rv.net01 | 364294266 | 568 kl/s | 641.33 s| 13 | ^[[2K +-----------------------------------------------------------------------+ 14 | ^[[2K[FINISHED] m3 ( Finished: 1 / Total: 1 ) 15 | ^[[2K [LOADED] 16 | ^[[2K +-----------------------------------------------------------------------+ 17 | ^[[2K | FILENAME | LOADED LINES | AVG SPEED | DURATION| 18 | ^[[2K |/ebs/split/twitter_rv.net02 | 363986051 | 562 kl/s | 646.83 s| 19 | ^[[2K +-----------------------------------------------------------------------+ 20 | ^[[2K[FINISHED] m4 ( Finished: 1 / Total: 1 ) 21 | ^[[2K [LOADED] 22 | ^[[2K +-----------------------------------------------------------------------+ 23 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 24 | |/ebs/split/twitter_rv.net03 | 363793057 | 667 kl/s | 544.77 s| 25 | +-----------------------------------------------------------------------+ 26 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/twitter-loading.6machine.r4.2xlarge: -------------------------------------------------------------------------------- 1 | tigergraph@ip-172-30-1-124:/home/ubuntu/ecosys/benchmark/tigergraph$ gsql -g twitter 'run loading job load_twitter_edge using file1="all:/ebs/split"' 2 | [Tip: Use "CTRL + C" to stop displaying the loading status update, then use "SHOW LOADING STATUS jobid" to track the loading progress again] 3 | [Tip: Manage loading jobs with "ABORT/RESUME LOADING JOB jobid"] 4 | Starting the following job, i.e. 5 | JobName: load_twitter_edge, jobid: twitter_m1.m2.m3.m4.m5.m6.1534219388512 6 | Loading log: '/ebs/install/tigergraph/logs/restpp/restpp_loader_logs/twitter/twitter_m1.m2.m3.m4.m5.m6.1534219388512.log' 7 | 8 | Job "twitter_m1.m2.m3.m4.m5.m6.1534219388512" loading status 9 | [FINISHED] m1 ( Finished: 1 / Total: 1 ) 10 | [LOADED] 11 | +-----------------------------------------------------------------------+ 12 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 13 | |/ebs/split/twitter_rv.net00 | 254743856 | 468 kl/s | 543.95 s| 14 | +-----------------------------------------------------------------------+ 15 | [FINISHED] m2 ( Finished: 1 / Total: 1 ) 16 | [LOADED] 17 | +-----------------------------------------------------------------------+ 18 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 19 | |/ebs/split/twitter_rv.net01 | 243029125 | 475 kl/s | 511.26 s| 20 | +-----------------------------------------------------------------------+ 21 | [FINISHED] m3 ( Finished: 1 / Total: 1 ) 22 | [LOADED] 23 | +-----------------------------------------------------------------------+ 24 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 25 | |/ebs/split/twitter_rv.net02 | 242813093 | 488 kl/s | 496.60 s| 26 | +-----------------------------------------------------------------------+ 27 | [FINISHED] m4 ( Finished: 1 / Total: 1 ) 28 | [LOADED] 29 | +-----------------------------------------------------------------------+ 30 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 31 | |/ebs/split/twitter_rv.net03 | 242685421 | 504 kl/s | 481.48 s| 32 | +-----------------------------------------------------------------------+ 33 | [FINISHED] m5 ( Finished: 1 / Total: 1 ) 34 | [LOADED] 35 | +-----------------------------------------------------------------------+ 36 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 37 | |/ebs/split/twitter_rv.net04 | 242585593 | 498 kl/s | 486.67 s| 38 | +-----------------------------------------------------------------------+ 39 | [FINISHED] m6 ( Finished: 1 / Total: 1 ) 40 | [LOADED] 41 | +-----------------------------------------------------------------------+ 42 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 43 | |/ebs/split/twitter_rv.net05 | 242508094 | 502 kl/s | 483.00 s| 44 | +-----------------------------------------------------------------------+ 45 | -------------------------------------------------------------------------------- /benchmark/tigergraph/result/twitter-loading.8machine.r4.2xlarge: -------------------------------------------------------------------------------- 1 | tigergraph@ip-172-30-1-124:/ebs$ gsql -g twitter 'run loading job load_twitter_edge using file1="all:/ebs/split/"' 2 | [Tip: Use "CTRL + C" to stop displaying the loading status update, then use "SHOW LOADING STATUS jobid" to track the loading progress again] 3 | [Tip: Manage loading jobs with "ABORT/RESUME LOADING JOB jobid"] 4 | Starting the following job, i.e. 5 | JobName: load_twitter_edge, jobid: twitter_m1.m2.m3.m4.m5.m6.m7.m8.1534206139284 6 | Loading log: '/ebs/install/tigergraph/logs/restpp/restpp_loader_logs/twitter/twitter_m1.m2.m3.m4.m5.m6.m7.m8.1534206139284.log' 7 | 8 | Job "twitter_m1.m2.m3.m4.m5.m6.m7.m8.1534206139284" loading status 9 | Job "twitter_m1.m2.m3.m4.m5.m6.m7.m8.1534206139284" loading status 10 | [FINISHED] m1 ( Finished: 1 / Total: 1 ) 11 | [LOADED] 12 | +-----------------------------------------------------------------------+ 13 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 14 | |/ebs/split/twitter_rv.net00 | 193921391 | 500 kl/s | 387.51 s| 15 | +-----------------------------------------------------------------------+ 16 | [FINISHED] m2 ( Finished: 1 / Total: 1 ) 17 | [LOADED] 18 | +-----------------------------------------------------------------------+ 19 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 20 | |/ebs/split/twitter_rv.net01 | 182370417 | 445 kl/s | 408.93 s| 21 | +-----------------------------------------------------------------------+ 22 | [FINISHED] m3 ( Finished: 1 / Total: 1 ) 23 | [LOADED] 24 | +-----------------------------------------------------------------------+ 25 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 26 | |/ebs/split/twitter_rv.net02 | 182199790 | 459 kl/s | 396.62 s| 27 | +-----------------------------------------------------------------------+ 28 | [FINISHED] m4 ( Finished: 1 / Total: 1 ) 29 | [LOADED] 30 | +-----------------------------------------------------------------------+ 31 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 32 | |/ebs/split/twitter_rv.net03 | 182094476 | 484 kl/s | 375.72 s| 33 | +-----------------------------------------------------------------------+ 34 | [FINISHED] m5 ( Finished: 1 / Total: 1 ) 35 | [LOADED] 36 | +-----------------------------------------------------------------------+ 37 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 38 | |/ebs/split/twitter_rv.net04 | 182022370 | 466 kl/s | 390.54 s| 39 | +-----------------------------------------------------------------------+ 40 | [FINISHED] m6 ( Finished: 1 / Total: 1 ) 41 | [LOADED] 42 | +-----------------------------------------------------------------------+ 43 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 44 | |/ebs/split/twitter_rv.net05 | 181963681 | 491 kl/s | 370.29 s| 45 | +-----------------------------------------------------------------------+ 46 | [FINISHED] m7 ( Finished: 1 / Total: 1 ) 47 | [LOADED] 48 | +-----------------------------------------------------------------------+ 49 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 50 | |/ebs/split/twitter_rv.net06 | 181920198 | 514 kl/s | 353.68 s| 51 | +-----------------------------------------------------------------------+ 52 | [FINISHED] m8 ( Finished: 1 / Total: 1 ) 53 | [LOADED] 54 | +-----------------------------------------------------------------------+ 55 | | FILENAME | LOADED LINES | AVG SPEED | DURATION| 56 | |/ebs/split/twitter_rv.net07 | 181872859 | 543 kl/s | 334.78 s| 57 | +-----------------------------------------------------------------------+ 58 | -------------------------------------------------------------------------------- /benchmark/tigergraph/split_distribute.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | usage(){ 4 | echo "Usage:" 5 | echo "./`basename $0` (src_dir) [tgt_dir] (file_extension:csv)" 6 | echo "e.g.: ./`basename $0` ~/raw_data ~/raw_data csv" 7 | echo "The script will split each raw files into n parts, n is the" 8 | echo "number of cluster nodes, and distribute one file part to" 9 | echo "each cluster nodes" 10 | exit 0 11 | } 12 | 13 | # path to raw data 14 | src_dir=$1 15 | 16 | if [ ! -d "$src_dir" ]; then 17 | echo "Cannot find source data dir: $src_dir" 18 | usage 19 | exit 1 20 | fi 21 | tgt_dir=$2 22 | tgt_dir=${tgt_dir:-$src_dir} 23 | if [ -z "$tgt_dir" ]; then 24 | echo "Must specify target dir: $src_dir" 25 | usage 26 | exit 1 27 | fi 28 | 29 | cluster_str=$(grep cluster.nodes ~/.gsql/gsql.cfg | cut -d' ' -f2) 30 | cluster_list=(${cluster_str//,/ }) 31 | # split to n partitions 32 | partition_num=${#cluster_list[@]} 33 | if [ -z "$partition_num" ]; then 34 | echo "Partition number must be specified" 35 | exit 1 36 | elif ! [[ "$partition_num" =~ ^[1-9][0-9]*$ ]]; then 37 | echo "Partition number must be positive integer" 38 | exit 1 39 | fi 40 | echo "partition_num: $partition_num" 41 | file_extension=$3 42 | # default extension: .csv 43 | file_extension=${file_extension:-csv} 44 | 45 | cd $src_dir 46 | 47 | # step 1, split data 48 | echo "=========== step one: split data ===========" 49 | for file in $(find ./ -type f -name "*.$file_extension" -printf "%f\n"); do 50 | echo "Spliting file: $file" 51 | split -n l/$partition_num -d $file $file || exit 1 52 | # rm -f $file 53 | done 54 | cd - 55 | 56 | o1="UserKnownHostsFile=/dev/null" 57 | o2="StrictHostKeyChecking=no" 58 | echo "=========== step two: distribute data ===========" 59 | grun all "mkdir -p $tgt_dir" || exit 1 60 | n=0 61 | for node in "${cluster_list[@]}"; do 62 | node_ip=$(echo $node | cut -d':' -f2) 63 | if /sbin/ip addr | grep inet | grep $node_ip 1>/dev/null && [ "$src_dir" = "$tgt_dir" ]; then 64 | echo "don't remove files on local machine, $node_ip" 65 | else 66 | echo "Scp to node $node_ip ..." 67 | if [ "$n" -gt 9 ]; then 68 | scp -i ~/.ssh/tigergraph_rsa -o $o1 -o $o2 $src_dir/*\.${file_extension}$n $node_ip:$tgt_dir 69 | rm -rf $src_dir/*\.${file_extension}$n 70 | else 71 | scp -i ~/.ssh/tigergraph_rsa -o $o1 -o $o2 $src_dir/*\.${file_extension}0$n $node_ip:$tgt_dir 72 | rm -rf $src_dir/*\.${file_extension}0$n 73 | fi 74 | fi 75 | n=$((n+1)) 76 | done 77 | #grun all "cd $src_dir; find . -name \"*.csv*\" -exec rename 's/csv.*$/csv/' {} \;" 78 | #grun all "cd $tgt_dir; find . -name \"*.${file_extension}*\" -exec rename 's/${file_extension}.*$/${file_extension}/' {} \;" 79 | echo "DONE" 80 | -------------------------------------------------------------------------------- /benchmark/tigergraph/twitter_rv.net-seed: -------------------------------------------------------------------------------- 1 | 20727483 50329304 26199460 1177521 27960125 30440025 15833920 15015183 33153097 21250581 28548532 42860945 22171728 15254388 44713775 44868770 16350915 33650477 56847735 18056455 32831346 56969867 73483 24981801 25726723 59109778 18381650 8467712 29781057 37886317 39357186 42520611 28471398 1288371 44112249 29088897 15568898 25038085 14075928 96 31835375 22480457 27104736 22687463 27576832 108 35792763 21373148 15234546 14379717 42744015 16927373 16727535 51520097 15078404 14199173 4517721 17323985 18218033 21828142 52674447 15285305 45827167 50826077 54064328 6941 33586608 204 22716284 34386420 36187082 31239408 40316879 10667662 46517052 24523660 14521821 18548221 41496166 27104314 27654423 1685871 23184686 23994973 60312372 8610562 38978212 19740592 18803424 30395784 35908081 21156271 20530182 23378124 29830423 44304625 28830907 31180323 17998925 46822485 42240052 45193938 53758197 20460235 52923055 16129920 15214045 19109927 15917338 27457788 38631864 50808075 19130449 11015592 24777262 14127710 28570061 29941438 15423869 20804997 22667467 26589987 45114047 18087450 961081 14231321 14050138 22742142 36412963 6444062 41608888 15492329 19632867 20194683 22286431 27558050 5120691 48570598 48459607 38407885 23686306 44807976 17129374 1775731 17872794 54491514 18812795 37479006 22281042 26116046 20841950 30244121 14854462 618593 19644074 15735493 43283406 24800750 22872869 20067354 15247448 20912620 20590051 14137268 20143330 18112970 17100967 16732759 54466171 52802702 20373034 32765375 24812106 11894652 51370393 3943871 53469420 14761795 365 46304581 3032431 20977546 21099347 42399917 796766 8909522 16460768 9121432 17919972 56643711 19226267 13221862 41259823 28466425 31806999 759251 59550897 22422221 14662772 15935591 36072333 14669432 14235317 46587124 33497221 41173269 14462907 15922433 22046932 8069572 17073811 19571299 23922282 37975089 71123 13141932 26784273 11172992 23718349 43097584 19829645 25365536 41213114 15683302 19867432 27923061 20536157 14610275 32959253 1045141 39940849 26591593 14293310 26149262 37889798 14803170 16548466 761393 17626181 1418 16609515 32629211 20534044 16797810 30096883 22508419 19124463 42532346 492 16278934 22787048 15163466 22382980 16557588 36880563 43146251 30859015 41716439 6102302 25555552 33370227 43251483 32209489 17910878 23742760 18979962 14230524 24608680 26643090 18659533 39616562 50848585 22359310 18954559 37440908 45251595 45830702 29861887 2884771 25941311 46484827 21407335 14987704 57721125 572 16350844 40926141 54916719 23511857 25515549 18591276 21035409 19923144 16841186 18583722 28335791 2557521 41470461 23006794 16418966 -------------------------------------------------------------------------------- /benchmark/tigergraph/twitter_setup.gsql: -------------------------------------------------------------------------------- 1 | drop all 2 | 3 | create vertex MyNode (primary_id id string) 4 | create directed edge MyEdge(from MyNode, to MyNode) 5 | create graph twitter(MyNode, MyEdge) 6 | 7 | USE GRAPH twitter 8 | CREATE LOADING JOB load_twitter_edge FOR GRAPH twitter { 9 | DEFINE FILENAME file1; 10 | 11 | LOAD file1 12 | TO EDGE MyEdge VALUES ($0, $1) USING header="false", separator="\t"; 13 | } 14 | 15 | @kn-twitter.gsql 16 | @wcc-twitter.gsql 17 | @pg-twitter.gsql 18 | 19 | install query all 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /benchmark/tigergraph/wcc-graph500.gsql: -------------------------------------------------------------------------------- 1 | ################################# 2 | # this wcc algorithm keep sending 3 | # the minimum vertex id it has seen 4 | # to each neighbor, update the neighbor 5 | # minimum seen vertex id. 6 | # Stop when there is no vertex that 7 | # can update its minumum seen 8 | # vertex id. 9 | ################################# 10 | 11 | 12 | use graph graph500 13 | 14 | drop query wcc 15 | 16 | create query wcc() for graph graph500 { 17 | SumAccum @@group_cnt = 0; 18 | int loop_count = 0; 19 | MinAccum @cc_id; 20 | 21 | OrAccum @changed_group= false; 22 | 23 | Start = {MyNode.*}; 24 | @@group_cnt = Start.size(); 25 | Start = select x from Start:x accum x.@cc_id = uid_to_vid(x); 26 | 27 | while (Start.size()>0) do 28 | Start= select y from Start:x - (MyEdge:e)-> :y 29 | where x.@cc_id < y.@cc_id 30 | accum y.@cc_id += x.@cc_id 31 | post-accum if (y.@changed_group ==false) then 32 | @@group_cnt += -1, y.@changed_group+=true 33 | end; 34 | 35 | loop_count += 1; 36 | end; 37 | Print @@group_cnt, loop_count; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /benchmark/tigergraph/wcc-twitter.gsql: -------------------------------------------------------------------------------- 1 | ################################# 2 | # this wcc algorithm keep sending 3 | # the minimum vertex id it has seen 4 | # to each neighbor, update the neighbor 5 | # minimum seen vertex id. 6 | # Stop when there is no vertex that 7 | # can update its minumum seen 8 | # vertex id. 9 | ################################# 10 | 11 | 12 | use graph twitter 13 | 14 | drop query wcc 15 | 16 | create query wcc() for graph twitter { 17 | SumAccum @@group_cnt = 0; 18 | int loop_count = 0; 19 | MinAccum @cc_id; 20 | 21 | OrAccum @changed_group= false; 22 | 23 | Start = {MyNode.*}; 24 | @@group_cnt = Start.size(); 25 | Start = select x from Start:x accum x.@cc_id = uid_to_vid(x); 26 | 27 | while (Start.size()>0) do 28 | Start= select y from Start:x - (MyEdge:e)-> :y 29 | where x.@cc_id < y.@cc_id 30 | accum y.@cc_id += x.@cc_id 31 | post-accum if (y.@changed_group ==false) then 32 | @@group_cnt += -1, y.@changed_group+=true 33 | end; 34 | 35 | loop_count += 1; 36 | end; 37 | Print @@group_cnt, loop_count; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /benchmark/tigergraph/wcc.py: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015-now, TigerGraph Inc. 3 | # All rights reserved 4 | # It is provided as it is for benchmark reproducible purpose. 5 | # anyone can use it for benchmark purpose with the 6 | # acknowledgement to TigerGraph. 7 | # Author: Mingxi Wu mingxi.wu@tigergraph.com 8 | ############################################################ 9 | import random 10 | import sys 11 | import os 12 | import datetime 13 | import errno 14 | 15 | from timeit import default_timer as timer 16 | 17 | from query_runner import * 18 | from config import * 19 | 20 | 21 | ########################################################### 22 | # Weakly Connected Component benchmark 23 | ########################################################### 24 | 25 | def RunWCC(filename, db_name, num_tests, notes = ""): 26 | """ 27 | #test,time 28 | ... 29 | summary,average_time 30 | """ 31 | #create result folder 32 | if not os.path.exists(os.path.dirname("./result/")): 33 | try: 34 | os.makedirs(os.path.dirname("./result/")) 35 | except OSError as exc: # Guard against race condition 36 | if exc.errno != errno.EEXIST: 37 | raise 38 | 39 | 40 | ofile = open("result/WCC-latency-" + db_name + "-" + filename, 'a') 41 | if db_name == "neo4j": 42 | runner = Neo4jQueryRunner() 43 | elif db_name == "tigergraph": 44 | runner = TigerGraphQueryRunner() 45 | else: 46 | print("invalid db " + db_name) 47 | total_time = 0.0 48 | report = "\n---------- " + str(datetime.datetime.now()) + " " + notes + " ----------\n" 49 | for i in range(0, num_tests): 50 | start = timer() 51 | runner.WCC() 52 | end = timer() 53 | exe_time = end - start 54 | total_time += exe_time 55 | line = str(i) + "," + str(exe_time) 56 | report += line + "\n" 57 | report += "summary, avg time " + str(total_time/num_tests) + " seconds" 58 | ofile.write(report) 59 | print (report) 60 | 61 | 62 | if __name__ == "__main__": 63 | # kn.py file_name db_name num_test 64 | if len(sys.argv) < 4: 65 | print("Usage: python wcc.py file_name db_name num_tests") 66 | print("e.g. python wcc.py /data/graph500/graph500-22 neo4j 3") 67 | print("e.g. python wcc.py /data/graph500/graph500-22 tigergraph 3") 68 | 69 | sys.exit() 70 | 71 | RunWCC(os.path.basename(sys.argv[1]), sys.argv[2], int(sys.argv[3]), sys.argv[4] if len(sys.argv) == 5 else "") 72 | --------------------------------------------------------------------------------