Alex
Alex
ATApache TinkerPop
Created by Alex on 12/11/2024 in #questions
How to create indexes by Label?
@triggan I found that just by calling g.V().limit(1) with concurrent calls on an r6g.2xlarge machine, the average time is 250ms, which I consider very high. But in the query mentioned, the bottleneck starts at the stage where it calls the last otherV() before path(). g.V().has(T.id, "client-id-uuid").bothE("has_profile", "has_affiliated", "has_controlling").has(T.id, containing("tenant-id-uuid")).otherV().path().unfold().dedup().elementMap().toList() Even trying other approaches, such as "inV()", and removing dedup(), the processing time is still very high. It takes 4-12s just to return the query. In the environment where I perform the test, I have 370k vertices and 360k edges. If I just make the call like this without bringing the rest of the data g.V().has(T.id, "client-id-uuid").bothE("has_profile", "has_affiliated", "has_controlling").has(T.id, containing("tenant-id-uuid")).path().unfold().dedup().elementMap().toList() it returns in 500ms. Do you know what other approach I could use to process this last item "otherV()" without bottlenecking?
11 replies
ATApache TinkerPop
Created by Alex on 12/11/2024 in #questions
How to create indexes by Label?
No description
11 replies
ATApache TinkerPop
Created by Alex on 11/28/2024 in #questions
How to Work with Transactions with Gremlin Python
I`m spending 150ms to insert some vertex and edges so I was looking for a better way to do that instead of using the method submit from client.Client with chained mergeV and mergeE (two requests to not have conflict between edges) But I didnt see any difference using transactions. Those tests were made on AWS Neptune with an api made in python with fastapi freamework. Local is difficult to test the performance because the response time is really different from the server.
10 replies
ATApache TinkerPop
Created by Alex on 11/28/2024 in #questions
How to Work with Transactions with Gremlin Python
I tried to call tx.rollback() after I did the mergeV inserts just to check if it works. It doenst rolled back the data inserted. But I discarded the option of using transactions because the performance was similar than using the chained mergeV() command.
10 replies
ATApache TinkerPop
Created by Alex on 11/28/2024 in #questions
How to Work with Transactions with Gremlin Python
Thanks for the response @Yang Xia, sorry for my lack of knowledge but what is the purpose of opening a transaction and commit its transaction if the iterate() send to the server already? Also the .rollback() doenst work if I try to use it after the iterate() on gremlin-server. I received this suggestion to use tranctions to try to have more performance than using query string, thats why I`m try to implement it and check the difference in performance.
10 replies
ATApache TinkerPop
Created by Alex on 10/11/2024 in #questions
Possibilities to improve performance on query?
That has this performance: [{'dur': 0.3111, 'metrics': [{'dur': 0.0705, 'counts': {}, 'name': 'TinkerGraphStep(vertex,[72fd3542-0bf2-45eb-8b5b-dc93a6404dc4])', 'annotations': {'percentDur': 22.66152362584378}, 'id': '0.0.0()'}, {'dur': 0.0806, 'counts': {}, 'name': 'VertexStep(BOTH,[has_profile, has_affiliated, has_controlling],edge)', 'annotations': {'percentDur': 25.908068145290905}, 'id': '2.0.0()'}, {'dur': 0.0196, 'counts': {}, 'name': 'HasStep([~id.containing(a8136fa9-b55a-47b1-9717-c4c44609f805)])', 'annotations': {'percentDur': 6.300225008036001}, 'id': '4.0.0()'}, {'dur': 0.022, 'counts': {}, 'name': 'EdgeOtherVertexStep', 'annotations': {'percentDur': 7.071681131468981}, 'id': '6.0.0()'}, {'dur': 0.0044, 'counts': {}, 'name': 'PathStep', 'annotations': {'percentDur': 1.4143362262937962}, 'id': '8.0.0()'}, {'dur': 0.0073, 'counts': {}, 'name': 'UnfoldStep', 'annotations': {'percentDur': 2.34651237544198}, 'id': '10.0.0()'}, {'dur': 0.0102, 'counts': {}, 'name': 'DedupGlobalStep(null,null)', 'annotations': {'percentDur': 3.278688524590164}, 'id': '12.0.0()'}, {'dur': 0.0965, 'counts': {}, 'name': 'ElementMapStep', 'annotations': {'percentDur': 31.018964963034396}, 'id': '14.0.0()'}]}]
7 replies
ATApache TinkerPop
Created by Alex on 10/11/2024 in #questions
Possibilities to improve performance on query?
So I changed to this new one: g.V().has(T.id, "72fd3542-0bf2-45eb-8b5b-dc93a6404dc4").bothE("has_profile", "has_affiliated", "has_controlling").has(T.id, containing("a8136fa9-b55a-47b1-9717-c4c44609f805")).otherV().path().unfold().dedup().elementMap().profile()
7 replies
ATApache TinkerPop
Created by Alex on 10/11/2024 in #questions
Possibilities to improve performance on query?
7 replies
ATApache TinkerPop
Created by Alex on 10/11/2024 in #questions
Possibilities to improve performance on query?
I changed the query a little bit but here it is: g.V().has(T.id, "72fd3542-0bf2-45eb-8b5b-dc93a6404dc4").union(.outE("has_profile").has(T.id, containing("a8136fa9-b55a-47b1-9717-c4c44609f805")).otherV().path(),.outE("has_affiliated").has(T.id, containing("a8136fa9-b55a-47b1-9717-c4c44609f805")).otherV().path(),__.bothE("has_controlling").has(T.id, containing("a8136fa9-b55a-47b1-9717-c4c44609f805")).otherV().path()).unfold().dedup().elementMap().profile()
7 replies
ATApache TinkerPop
Created by Alex on 10/10/2024 in #questions
Neptune Cluster Balancing Configuration
Im using this implementation in Python: client_read = client.Client(ws://url_neptune_read:8182/gremlin, "g", transport_factory=lambda: AiohttpTransport(call_from_event_loop=True), message_serializer=serializer.GraphSONMessageSerializer()) client_write = client.Client(ws://url_neptune_write:8182/gremlin, "g", transport_factory=lambda: AiohttpTransport(call_from_event_loop=True), message_serializer=serializer.GraphSONMessageSerializer()) client_read.submit("query_read").all().result() client_write.submit("query_write").all().result() And thanks, Im gonna look this doc.
5 replies