Slow Response Time

Hi, I'm using workers + d1 and my domain is managed by the Cloudflare and my service is responding ~300ms to return a static object with the version of the API. Can someone help me to improve this? In Brazil, for example, the DNS response is very slow...
No description
13 Replies
Emerson
EmersonOP2mo ago
Testing with real user directly from the browser.
No description
Chaika
Chaika2mo ago
I would ignore DNS in those tests, it's entirely unrelated to the worker or anything else, and more to do with the local dns resolver they're using
Chaika
Chaika2mo ago
my service is responding ~300ms to return a static object with the version of the API.
D1 doesn't run in Brazil, it runs off Durable Objects, and for South America the closest locations are Miami or New York/Newark: https://where.durableobjects.live/colo/GRU Did you create your D1 Db with a specific location hint? I assume you're not caching the response at all
Where Durable Objects Live
São Paulo, São Paulo, Brazil (colo)
Tracking where Durable Objects are created, wherever you are in the world.
Emerson
EmersonOP2mo ago
Hi @Chaika i don't create with a specific location, how can i do that? And about the cache, you're right, I'm chaching anything, but this print is about a static object response. You can check here https://api.cortesia.app/
Chaika
Chaika2mo ago
If you didn't create it with a hint, and you're in South America/send the request from there, should have ended up in Eastern US then
You can check here https://api.cortesia.app/
What's the endpoint for the static object?
Emerson
EmersonOP2mo ago
isn't an object, sorry, it's this simple text with the version yes, I created from Brazil. How can I check the current location for my d1?
Chaika
Chaika2mo ago
ahh ok, yea it's way better for me up here in New York:
No description
Chaika
Chaika2mo ago
npx wrangler d1 info <db-name>, if you don't have wrangler/cli, it's a safe assumption it's enam
Emerson
EmersonOP2mo ago
Okay, is running on ENAM
Chaika
Chaika2mo ago
D1 just isn't replicated nor does it have a South America region/location. It's a single isolate/instance on a single machine in a single region. If you want faster global performance and can give up consistency, consider Cloudflare KV
Emerson
EmersonOP2mo ago
wow, it's not good news. Okay, thank you! Do you have knowledge about support to d1 on SA or where I can follow updates about it? Because I want to use SQL in CF with a good performance and KV is like a workaround in my case.
Chaika
Chaika2mo ago
Cloudflare doesn't really give ETAs or promises, most they said, which was nearly 7 months ago now, was "They would like to get India and South America stood up by end of year" https://discord.com/channels/595317990191398933/773219443911819284/1230160840443826237
Emerson
EmersonOP2mo ago
Now yes, some good news! hehe, thanks @Chaika !
Want results from more Discord servers?
Add your server