When I’m connecting to a remote standalone Grakn server, relatively simple operations, take much longer time than expected.
I haven’t touched any of the configurations (i.e. Titan & Cassandra backend), except changing IP addresses according to this discussion.
I wrote a minimal ontology:
OntologyEntity sub entity, has ontology-name;
ontology-name sub resource, datatype string;
$e isa OntologyEntity, has ontology-name “name”;
And my Java app does the following steps:
- Receives GraknGraph (WRITE) connection.
- Deletes the entire keyspace.
- Receives another GraknGraph (WRITE) connection.
- Loads the ontology through a GraqlAPI and commits it.
- Receives GraknGraph (READ) connection.
- Queries the ontology-name of my OntologyEntity with the GraqlAPI:
match $e isa OntologyEntity, has ontology-name $n;
I’m running the same .jar file from three different machines:
- a) The machine that runs the server.
- b) Remote client in the same country as the first one.
- c) My machine, in a different country.
Receiving the first WRITE connection on my machine (1.c) takes ~20 sec.
The second WRITE connection (3.c), that I assume also creates the keyspace from scratch - takes up to a minute.
Running the READ query (6.c) takes ~3 sec.
Running it on machine b is about 5 times faster, but is still quite slow, if I would like to write data in real-time…
Is this normal behavior?
Are there any “quick” changes I can apply in order to improve the performance, or do I need to implement a solution similar to what you did with the API.AI chatbot (i.e. messaging the queries/parameters to the server) in order to receive quick responses?