Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 BUG: 5x higher fetch latency without Cloudflare DNS on Windows with WSL2 #3925

Closed
205g0 opened this issue Sep 11, 2023 · 4 comments
Closed
Labels
bug Something that isn't working

Comments

@205g0
Copy link

205g0 commented Sep 11, 2023

Which Cloudflare product(s) does this pertain to?

Wrangler core

What version(s) of the tool(s) are you using?

3.7.0

What version of Node are you using?

18.7.1

What operating system are you using?

WSL2

Describe the Bug

Testing db queries against PlanetScale via Drizzle ORM, a simple find in an indexed table with 30 records takes whopping 4.7sec. First, I though it must be Drizzle or PlanetScale but then realized that I was on a new machine where I haven't switched to Cloudflare's DNS 1.1.1.1 yet.

Once I've switched, bam, 0.8sec for the request (be aware that I and the PlanetScale are far apart). On production it's then about 0.3sec).

Please provide a link to a minimal reproduction

just a/b-test any app with a fetch with CF DNS and without

Please provide any relevant error logs

No response

@kentonv
Copy link
Member

kentonv commented Sep 11, 2023

Nothing in wrangler, miniflare, or workerd treat 1.1.1.1 specially. DNS requests are just delegated to the regular DNS libraries that all apps use. So, I don't see how this could be a bug in any of our code. It sounds more like a problem with your regular DNS provider -- maybe it's just a lot slower than 1.1.1.1?

@205g0
Copy link
Author

205g0 commented Sep 12, 2023

Ok, good points. I just tried it with Google's DNS 8.8.8.8 and it's also faster (not as fast as CF's though) than what I had initially. The point is鈥擨 have had this with every new set up Windows WSL2 laptop. And I forget about changing my DNS every single time. And others will have this too and the cause ("change your DNS") is so far away that it should be in the docs at least. Also, who changes their DNS settings? Some might but most leave them to Windows default ones.

Plus, I have this with no other setup, e.g. some node server running in Docker fetching around.

Let me know if I should close but this issue can be such a big annoyance which is hard to track ("is it my DB, my ORM, ...??").

@mrbbot
Copy link
Contributor

mrbbot commented Oct 5, 2023

Hey! 馃憢 As @kentonv points out, we don't treat 1.1.1.1 specially and this is likely an issue with your regular DNS provider. I wasn't able to reproduce a significant slowdown using WSL 2 and an alternative DNS (mobile data via iPhone hotspot with Cloudflare WARP disabled, verified with https://1.1.1.1/help). I'd expect 1.1.1.1 to make things faster, but this does not seem to be an issue with Wrangler, so we're going to close the issue.

@mrbbot mrbbot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
@205g0
Copy link
Author

205g0 commented Oct 17, 2023

thanks for looking into it, fyi i just set up a new machine and got this: #3121 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants