Are local deployments also rate limited?
# orm-help
b
Are local deployments also rate limited?
d
No, local deployments are not rate limited.
b
I think I am hitting the rate limit on my own instances. Either this or prisma is extremely slow. It won't go over 1 request per second without giving a timeout. Have you or anybody else faced this issue?
d
How much amount of data you have on your local? How does your query response size look like in network tab?
m
and please paste the
endpoint
property from your
prisma.yml
👍 1
b
It's a test project, there are less than 100 nodes on the server
The thing is that I'm not performing a join or operating with high volumes of data. It should be nearly instant yet it is limited to 1 request per second
Could this be a known bug?
I have restarted the instance and connected to it using a secret and worked fine
Is there a rate limit applied to "anonymous" users? Maybe? Or should I report this as a bug?
d
Nope, there is no rate limiting. Maybe the docker container was acting weirdly and the restart fixed it? Can you remove the secret and try if it gets slowed again?
b
Will do
I have faced the issue again with and without the secret put on
Sometimes it works and sometimes it doesn't
m
@Biel Simon: What kind of hardware is your server running on?
b
OS: Linux localhost.localdomain 4.4.0-116-generic #140-Ubuntu HW: Intel(R) Xeon(R) CPU E5-2683 v3 @ 2.00GHz 4 Core
Locally (SSD and Core i7) it happened sometimes as well
I think it is not poor performance since both at times it works as expected and if it was prisma would be unusable in production by anyone
Has anything similar happened in the past?
I am willing to provide more information to help resolve this issue
d
Thanks for all the information, I am not aware of people running into similar issues on their local. Can you check your docker container logs? Would it be possible for you to share your project via Github (a reproduction) for us to try?
b
I am trying to perform a data migration into prisma and I am interacting with it with the generated client
Could the client be at fault?
Okay I'll look into that
d
Depends on how the migration is being performed. I would love to be able to reproduce this on my machine 🙂
m
@divyendu: the
endpoint
property in his config rather points to a deployed server, right?
👍 1
d
It could be a deployed server, maybe rerouted via hosts file? @Biel Simon: can you confirm if the server is on the same machine or on some other machine on the network?
It is not a "prisma migration". It is a script that inserts data
This is a relevant fragment
const db = new Prisma({ // endpoint: 'http://remote-server.com:4466', // endpoint: 'http://localhost:4466', secret: "a334455", debug: false })
I would need authorization to be able to share the actual remote server
d
and what would be the value of
oldProducts.length
?
b
Approximately 200
When it works it takes more or less 10 seconds (which is fine)
But when it doesn't it gets stuck after 10 products or so
d
So, network calls in a loop is not the best idea, can you try to throttle this? Client could also be adding to this overhead for this case because of secret resolution for each request.
b
Even considering that I am awaiting them?
I don't nned it to be blazing fast. The thing is that when it lags, it times out after 10 requests or so
If I put a sleep(1000) it crashes after 180 products or maybe it gets to completion
I have tried it
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
d
Okay, thanks! if possible, can you share your project + data for me to try this on my end?
b
I will try and see what I can share
d
I would like to repro it here! Also, can you try to update to the latest beta for
prisma-client-lib
? We did fix a memory leak today but that should not have been big enough to cause this issue. https://github.com/prisma/prisma/issues/3732
Please share your finding, feel free to move this conversation to a DM 🙂