I have the schema for one of my Mongo Collection d...
# prisma1-community
s
I have the schema for one of my Mongo Collection defined as
type TM {
id: ID! @id
url: String! @unique
clientId: String!
sourceHashes: [String]
translations: [Translations!]!
}
Now when I use the Prisma query call such as (NodeJS)
const urlData = await <http://prisma.tM|prisma.tM>({
url: "some url"
});
It almost takes 7-11 seconds for Prisma to return results. This lag is not there if I directly connect to Mongo and query. What is happening here? @Ryan Anything additional I must be doing?
r
Hey @Suhail đź‘‹ Are you querying to MongoDB directly from the same place where the Prisma server is hosted or are you querying locally?
s
I queried mongo locally and then queried through prisma locally. Mongo would respond in a second..prisma 7-11 seconds
Any idea what could be wrong here?
@Ryan
r
How much memory have you allocated?
s
It is still on 4GB (Heap) 8GB (RAM). I have added a request to increase it. But it gets hard to justify these requirements, given it works fine without Prisma with the same memory setup.
Is it possible to see the final query Prisma is making on Mongo? Possible that something is wrong with Prisma?
r
Are you running your Prisma server locally via Docker?
Because there should’t be so much of a time difference while executing queries.
s
yes
mongo is on a different VM
Mongo and prisma are communicating through internet
@Ryan I have got the RAM increased to 12 GB and heap size increased to 8 GB. Is there a way to know what is the best suitable configuration? How many cores would you suggest? How would I know I am working with the optimal RAM and heap size?
Currently I have allocated 3 cores + 12 GB RAM + 8 GB Heap
Copy code
[INFO] Closed connection [connectionId{localValue:125}] to xx.xx.xx.xx:27017 because there was a socket exception raised by this connection.
Uncaught error from thread [single-server-akka.actor.default-dispatcher-22]: GC overhead limit exceeded, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[single-server]
java.lang.OutOfMemoryError: GC overhead limit exceeded
[INFO] Closed connection [connectionId{localValue:138, serverValue:10067}] to xx.xx.xx.xx:27017 because there was a socket exception raised on another connection from this pool.
[INFO] Opened connection [connectionId{localValue:141, serverValue:10085}] to xx.xx.xx.xx:27017
Can you help @Ryan?
r
I have asked the team for more insight on this and they will get back soon.
s
Yes please, I have started migrating some of my queries on mongoose because the crash is occurring randomly. I do not want to lose Prisma but won't have an option if the situation does not get resolved very quickly. My production system applications are dependent on this @Ryan
Any update @Ryan?
r
Not yet @Suhail Still to verify, could you check if you have configured the JVM to use these resources? As it really shouldn’t be that long to return the results if enough resources are occupied.
s
How do I verify?
r
When you’re making the query, what amount of memory is the Prisma server using and can the JVM use the given memory.
s
How do I verify this? Is there a particular command I must run?