Hi
I picked the latest released Blueprints support using OrientGraph and
wanted to insert a bunch of vertices (1000 vertices between each commit)
with a few properties (5:ish) and wanted indices on each property.
When I have declared key-index for each property the commits become very
slow.
I wrote at small test where it creates 5 key-indices and then inserts 1000
vertices between commits and each vertex has 5 properties (with different
types).
It takes over 2 second for each commit which leaves the average insertion
time to around 300 vertices/sec. That seems a bit slow.
Running my test on a Mac Book Pro (4 core 2.3 GHz Core i7 and 250GB SSD
disk) I get this output:
Inserted 1000 vertices. Insert:430ms Commit:2110ms (393 vertices/sec)
Inserted 2000 vertices. Insert:120ms Commit:2049ms (461 vertices/sec)
Inserted 3000 vertices. Insert:83ms Commit:2113ms (455 vertices/sec)
Inserted 4000 vertices. Insert:41ms Commit:2241ms (438 vertices/sec)
Inserted 5000 vertices. Insert:32ms Commit:2662ms (371 vertices/sec)
Inserted 6000 vertices. Insert:32ms Commit:3139ms (315 vertices/sec)
Inserted 7000 vertices. Insert:34ms Commit:3584ms (276 vertices/sec)
Inserted 8000 vertices. Insert:33ms Commit:3888ms (255 vertices/sec)
Inserted 9000 vertices. Insert:33ms Commit:4322ms (229 vertices/sec)
The test is using:
OGlobalConfiguration.INDEX_AUTO_LAZY_UPDATES.setValue(-1);
declareIntent(new OIntentMassiveInsert());
I'm using: blueprints-orient-graph-2.4.0
which has these dependencies:
blueprints-core-2.4.0
orientdb-core-1.5.0
Is there any way to tune this or is this the expected speed?
A side note regarding disk space used. This test that inserts 10k vertices
(with properties and indices) results in 1GB of total disk space used by
OrientGraph. Isn't that a bit much?
Thanks,
Konrad
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.orient.OrientGraph;
public class OrientGraphIndexTest {
public OrientGraphIndexTest(String path) {
OGlobalConfiguration.INDEX_AUTO_LAZY_UPDATES.setValue(-1);
OrientGraph graph = new OrientGraph("plocal:"+path);
ODatabaseDocumentTx db = graph.getRawGraph();
db.declareIntent(new OIntentMassiveInsert());
graph.createKeyIndex("int", Vertex.class);
graph.createKeyIndex("long", Vertex.class);
graph.createKeyIndex("name", Vertex.class);
graph.createKeyIndex("string", Vertex.class);
graph.createKeyIndex("boolean", Vertex.class);
int totalVertices = 10000;
int commitInterval = 1000;
long lastTime = System.currentTimeMillis();
for(int i = 0; i < totalVertices; i++) {
Vertex v = graph.addVertex(null);
v.setProperty("int", i);
v.setProperty("long", 10340340350530355L + i);
v.setProperty("name", "name"+i);
v.setProperty("string", "Some longer string that we need to add as property to the vertex");
v.setProperty("boolean", (i % 1));
if(i % commitInterval == 0 && i > 0) {
long time = System.currentTimeMillis();
graph.commit();
long commitTime = System.currentTimeMillis();
long vPerSec = (commitInterval * 1000L) / (commitTime - lastTime);
System.out.println("Inserted "+i+" vertices. Insert:"+(time-lastTime)+
"ms Commit:"+(commitTime-time)+"ms ("+vPerSec+" vertices/sec)");
lastTime = System.currentTimeMillis();
}
}
graph.commit();
graph.shutdown();
}
public static void main(String[] args) {
// Param1: path of where to store DB files
new OrientGraphIndexTest(args[0]);
}
}