X

Oracle Spatial and Graph – technical tips, best practices, and news from the product team

Using SSD to Speed up Property Graph Operations in Oracle Database (II)

Alan Wu
Architect

This is the second installment of the series "Using SSD to Speed up Property Graph Operations in Oracle Database." Click here for the first one.

In this blog, I am going to share with you a follow up test after the graph data was loaded into the database. The same hardware and the same Oracle Database version are used as those in the first installment. However, I upgraded the OS version to the latest EL7. The upgrade was not related to this graph database performance series but rather due to a need to run Docker engine on the same hardware system.

OK, enough talking, let's see some code snippets.

On the PGX side, before I started the PGX server, I set the following options.

export _JAVA_OPTIONS="-Dpgx.num_workers_io=8 -Dpgx.max_off_heap_size=12000 -Dpgx.num_workers_analysis=8 -Xmx12000m "

Then, I kicked off the following Groovy script (Java code snippets).

opg-oracledb> cfg = GraphConfigBuilder.forPropertyGraphRdbms().setJdbcUrl("jdbc:oracle:thin:@127.0.0.1:1521:orcl122") .setUsername("pg").setPassword("<YOUR_PASSWORD_HERE>") .setName("lj1") .setMaxNumConnections(16) .setLoadEdgeLabel(false).addEdgeProperty("weight", PropertyType.DOUBLE, "1000000")  .build();

pgxServer="http://127.0.0.1:7007/"
lStarttime=System.currentTimeMillis();
pgxSession=Pgx.getInstance(pgxServer).createSession("session1");
pgxGraph = pgxSession.readGraphWithProperties(opg.getConfig());
System.out.println("total ms " + (System.currentTimeMillis() - lStarttime));

I did three consecutive runs (cold, warm, hot) and the time took to read this 70M-edges graph were:

  • total ms 117335
  • total ms 87873
  • total ms 86983

As you can see, a warm run took a bit less than 90 seconds to read the whole graph into PGX's in-memory data structures.

During the graph reading, I did a top to see the system workload and observed the following. It is obvious that both the Java process (PGX) and the database were working hard in parallel. 

Tasks: 597 total,   4 running, 593 sleeping,   0 stopped,   0 zombie
%Cpu(s): 30.0 us,  2.7 sy,  0.0 ni, 53.2 id, 13.1 wa,  0.0 hi,  1.0 si,  0.0 st
KiB Mem : 65698368 total,  5023204 free, 15870304 used, 44804860 buff/cache
KiB Swap: 28344760 total, 28342916 free,     1844 used. 37149828 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                       
16600 user       20   0 20.575g 3.079g  25348 S 214.2  4.9   1:13.57 java                                          
17282 user       20   0 19.236g 275956 269628 D  22.8  0.4   0:02.95 oracle_17282_or                               
17256 user       20   0 19.236g 302200 295284 D  21.5  0.5   0:02.93 oracle_17256_or                               
17258 user       20   0 19.236g 274808 268480 S  21.2  0.4   0:02.98 oracle_17258_or                               
17262 user       20   0 19.236g 276572 270252 S  21.2  0.4   0:02.90 oracle_17262_or                               
17264 user       20   0 19.236g 275912 269580 D  21.2  0.4   0:03.00 oracle_17264_or                               
17268 user       20   0 19.236g 274812 268460 D  21.2  0.4   0:02.97 oracle_17268_or                               
17270 user       20   0 19.236g 269464 263136 D  21.2  0.4   0:02.79 oracle_17270_or                               
17278 user       20   0 19.236g 273056 266724 R  21.2  0.4   0:02.92 oracle_17278_or 

Cheers,

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.