I'm getting connect ETIMEDOUT errors when Im tryin...
# orm-help
r
I'm getting connect ETIMEDOUT errors when Im trying to pass a larger number of mutations(500) to my zeit now endpoint. Could someone perhaps tell me what I am doing wrong? This used to be no problem at all when using Graphcool Framework
h
Smaller batches?
r
Isn't there some automatic batching? Its 500 create mutations
m
Do these mutations access the prisma backend? The free prisma service is limited to a certain bandwidth (I think about 1 request/s). They cache some requests and are somewhat flexible resulting in small delays, but at some point the cache limit is reached and the prisma service stops responding. I solved the same issue by just adding a 1 second timeout in my scripts after each mutation. Takes some time but does the job 🙂 If it bothers you consider hosting your own prisma instance in docker.
r
Im paying for prisma cloud, so I dont think it is rate limited
or is it also for paying prisma cloud users?
h
Yea, there is limit
m
Im sure they have some kind of rate limits to manage their infrastructure, but they should be reasonably high for paying user. 500 mutations should not be a problem for a paying user 🙂 Dont have any numbers though
r
thats what I thought
h
n
Is
ETIMEOUT
returned by your
now
endpoint?
r
it is
n
what happens if you send 500 other HTTP requests?
sounds like
now
doesn't like you to bomb their endpoint 🙂
m
For me on the free plan, the same scenario occured when bombing the prisma endpoint directly 🙂
n
through
now
?
r
But I am not on the free plan though, I have my own cluster
n
I never saw a Prisma API return
ETIMEDOUT
. Isn't that a node error message?
r
yeah its the request itself that fails
not the prisma endpoint
I also never had any troubles while doing this with graphcool framework
m
Let me reproduce again to double check 🤒 I have a local seeding script written in JS directly talking to my prisma endpoint.
n
That's quite irrelevant 🙂 You also never used
now
with GFC, right?
Would be great if you can learn more about this @rein, for example try to use a delay between mutations as @Moritz suggested
r
Ill let you know!
n
You can also look into your DB metrics when doing those queries/mutations
if you see something suspicious there, you can try the same with a beefier DB
r
I dont think its that big of a load, but who knows
It worked fine on graphcool framework on a free plan
so
but ill do some testing
h
because it went trought different infrastructure
n
let's gather data, then we know more 🙂
h
zeit made some changes to their infrastructure because a lot of DDOS
try to host your graphql server on different provider maybe it will handle okey 🙂
m
@nilan Haha ok so I reran my script and everything went through fine this time, even without any delays between mutations. Prisma seems to have been doing some fitness 🙂 2800 requests in 15 minutes on the free plan without any issues. My issue before might thus have been of a local or connection nature like you suggested. Nice performance, props! 🙌
👌 1
@rein You can directly call mutations on your prisma endpoint via a script as such. (If you want to avoid going through
now
, might save you the trouble, this is what I use for seeding large amounts of data from json files. ) https://gist.github.com/moritzmorgenroth/10fa13fbb563263d7ec4d0259b044b7d