any tips on debugging slow queries- I’m seeing 2-3...
# prisma-whats-new
w
any tips on debugging slow queries- I’m seeing 2-3 seconds on some queries
h
you can track queries
w
like in playground?
It just tells me the entire query is slow, which I know.. I want to know why it’s slow http://wes.io/pQhG
h
yea, but you need to have yoga for example
and how looks your resolver?
w
it’s jsut two queries..
h
do you use prisma cloud or local?
w
cloud
n
where are your server and prisma cluster deployed? what's your
prisma-binding
version?
note that the public cluster employs a rate limit of 1 request/s
w
@nilan “prisma-binding”: “1.5.7"
us1.prisma.sh
1 request per second eh?
so if I want to query something, and then update it, it will take at least 1.1 seconds?
or if 60 people visit my site, it will take 1 min for the 60th person to view the site?
n
I collected more information about the rate limiting here: https://github.com/graphcool/prisma/issues/1863
can you share your resolver?
ah see it now
how do you deploy your GraphQL Server? there might be high latency between your server and the Prisma cluster
w
@nilan the yoga server? its local
n
gotcha! could you try
ping us1.prisma.sh
?
w
PING cluster-public-us-west-2-734360691.us-west-2.elb.amazonaws.com (52.89.189.152): 56 data bytes 64 bytes from 52.89.189.152: icmp_seq=0 ttl=235 time=81.243 ms 64 bytes from 52.89.189.152: icmp_seq=1 ttl=235 time=81.571 ms 64 bytes from 52.89.189.152: icmp_seq=2 ttl=235 time=82.323 ms
its not all queries, just that one
so if you are rate limiting it- that would explain it
n
right!
w
that is pretty agressive- is the only way around that to host locally?
i can’t really see me doing a video series with such a laggy UI
h
use local prisma instance?
w
I just asked that
the whole docker thing is a nightmare in tutorials
seems easy in concept but people get so frustrated and ask for refunds because they can’t get past the local installs
d
@wesbos: Hi 👋, 1. You should be able to set your own cluster on DO and use it as a shared cluster for videos i.e. no rate-limiting, you managing the infra... in theory this should be possible with
prisma add cluster
Let me know if you want me to try and validate this! 2. For debugging slow queries, I am exploring connecting yoga to apollo engine https://engine.apollographql.com will share my findings on that soon! 👍
l
I have the same issues as Wes, but figured it was part of the public cluster. I'll be buying your course, and I wouldn't mind a sleight of hand deploying locally for the video but teaching the cloud... or it could be viewed as an opportunity for sophisticated optimistic UI updates! 🙂
n
We'll look into lifting this limit over time, but we want to make extra sure that the development cluster is protected from malicious/accidental request bombarding 🙂 Thanks for your feedback on this one, everyone 🙌
b
@wesbos what do you think about a limit of 60 requests/minute. I think that would feel less laggy. https://github.com/graphcool/prisma/issues/1863#issuecomment-364542184
w
@divyendu thank you - I did’t think of hosting my own cluster. I could obviously have many apps on that?
👍 1
n
yes 🙂
m
@wesbos let me know what you end up doing 🙂 I'm also seeing slow response times between server and prisma (co-located in same AWS region). If I run tons of queries off a data heavy page it slows to 10 seconds per request. I hope it's just the throttling.