Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-02-2023 09:03 AM
I'm creating an API to manage a Neo4j database.
I started the project in Serverless with Node.js. My API is already registering and performing searches, by node ID and also by properties.
But I'm getting a much slower response time than I thought I would.
In the first query, it takes an average of 2 seconds, and when I test it repeatedly, the response is around 500 ms.
I tested refactoring the API using Node.js with Express.js, but the response time remains the same (first request 2 seconds and other requests, 500 ms on average).
I created an Index for the label and the property that I'm using in the search (code) and the minimum response time reduced to just over 400 ms (which I still consider a very long time).
I also noticed that the request that is made in "browser.neo4j.io" is taking an average of 500 ms in the first request and approximately 200 ms in the other requests (although the response time message displayed on the screen is 2 ms).
I have other APIs that interact with other types of databases and their response times are much faster. I have an API made in Node, running on an AWS EC2, connected to a PostgreSQL database, for example, which has an average response time of 40 ms.
Is this response time normal, even if I create an Index for this label and this node property?
Note: I am located in Rio de Janeiro, Brazil.
My PostgreSQL API server is located in São Paulo, Brazil (450 km away).
Does the fact that my Neo4j server is on a GCP server and located in Iowa, USA (us-central1), 8,697 km away, make all that difference in the response time?
01-02-2023 01:36 PM
You could try creating and endpoint that returns a literal string to see what the round trip time is without neo4j. Or, are you able to ping the server?
01-02-2023 05:36 PM
Can you check the actual query logs to see how much time the database actually taking to complete the work?
These are the things that can affect the response times.
Please run profile of the query in the browser and share the results. It is possible either database is doing too much work or returning lot of data.
All the sessions of the conference are now available online