Nuxt 3 cold start, random long loading, DNS Resolution/Waiting for server response issue

I have developed a rather simple site on nuxt 3 that I have deployed on Netlify, everything works but it happens randomly that the first loading of the site takes a considerable time.

I have tried to manipulate several aspects of the nuxt 3 configuration file and have not been able to find a solution to my problem.

However, the problem only occurs when the site is not visited for a certain period of time (ten/twenty minutes), once the first long load is over, all subsequent loads (within a short period of time will be instantaneous).

This is the website:

Which I also put on one of my domains:

https://leaf.agence-aurion.fr/

Here is an x-nf-request-id that takes more than 10s

x-nf-request-id: 01G8S0W6ZVCK65Z7Z20XEDVWVT

Here is a screenshot of the request:

Apparently most of the loading time is due to “DNS Resolution” nd also “Waiting for server response”.

How can I improve this?

Hi @Tonyweb

I took a closer look at our logs and it seems we’re serving that request within the expected time, by the time it reaches our network so it must be something on DNS resolution.

Can you please:

Hope this helps!

Hello, thanks for you answer :

- try with a different device/network : thats is the same thing, all the friends I have asked to visit the website have this problem and it’s not the first time, i have another site on Netlify with the same issue : https://bellanger.agence-aurion.fr/

Netlify looks very good, but currently in France, it seems that there are latency issues that prevent me from using it seriously.

You still didn’t answer/try the 2 other options. Netlify works perfectly in France. The fact that it’s taking so long in DNS resolution means that the connection is not even hitting Netlify.

We checked and your DNS is not even being managed by Netlify. You should probably contact your DNS host to find out about the latencies in DNS resolution.

I tried with a VPN but the problem is the same, the first load after a while without going to the site can take more than 10s, once loaded if I refresh the page I have no problem.

Anyway the problem can’t be solved by asking users to have a VPN or to change their DNS. As mentioned before the problem occurs with several people, on several types of computers/phones, on several types of networks.

The domain https://www.leaf-band.com/ and https://bellanger.agence-aurion.fr/ are both hosted on ovh.com, we are a web agency and a lot of the sites we have developed are behind domains hosted on ovh.com pointing to dedicated servers and we have no problems. However, as soon as I point one of these domains to a site hosted on netlify, I get huge latencies.

https://www.agence-aurion.fr/ → Main domain pointing to an ovh server = instant loading.

https://bellanger.agence-aurion.fr/ → Subdomain of the above main domain pointing to netlify = random DNS resolutions issues

Hi, @Tonyweb. It looks like you are trying to delegate the DNS for a subdomain of agence-aurion.fr to Netlify DNS. I say this based on the following recursive query for the IP address for agence-aurion.fr`:

$ dig +trace bellanger.agence-aurion.fr A

; <<>> DiG 9.10.6 <<>> +trace bellanger.agence-aurion.fr A
;; global options: +cmd
.			48633	IN	NS	e.root-servers.net.
.			48633	IN	NS	h.root-servers.net.
.			48633	IN	NS	l.root-servers.net.
.			48633	IN	NS	i.root-servers.net.
.			48633	IN	NS	a.root-servers.net.
.			48633	IN	NS	d.root-servers.net.
.			48633	IN	NS	c.root-servers.net.
.			48633	IN	NS	b.root-servers.net.
.			48633	IN	NS	j.root-servers.net.
.			48633	IN	NS	k.root-servers.net.
.			48633	IN	NS	g.root-servers.net.
.			48633	IN	NS	m.root-servers.net.
.			48633	IN	NS	f.root-servers.net.
.			48633	IN	RRSIG	NS 8 0 518400 20220815170000 20220802160000 20826 . heNj7Re3XSAOExs0gjIUX7r2QlSVLhEb0BL8lHeu50XRFcWN8A1HpXab EHmoH0BpaMmjMMs2AcULkdCq8rFGndxsJ6NIBMppv9P5DtvikOjvG6MJ XiYjl4bdW+UcjEJStrFl2XsHf7gVxVyRug+UyM47ha43kqiDHBf4O+KU 9t1Fcpy6y8qG7HOVFOeSAPdbGSs6R1SjF4HWaP9j+MdCXGPf69yWE7LO q3tphApzpaiDwzGoRH+h2vcJ8WFseNeEPRWf0sssFSwRedC2ri2KVcS4 p3Sy/txy2KNWvHYfuNYYNEe6Ek5X2Yco2vQ5dkWmQXC0O2JSjttsR6Wh 2OOdTg==
;; Received 525 bytes from 8.8.8.8#53(8.8.8.8) in 63 ms

fr.			172800	IN	NS	e.ext.nic.fr.
fr.			172800	IN	NS	f.ext.nic.fr.
fr.			172800	IN	NS	g.ext.nic.fr.
fr.			172800	IN	NS	d.nic.fr.
fr.			86400	IN	DS	51508 13 2 1B3386864D30CCC8F4541B985BF2CA320E4F52C57C53353F6D29C9AD 58A5671F
fr.			86400	IN	RRSIG	DS 8 1 86400 20220816050000 20220803040000 20826 . J3KBO9g49Afy+4a1EvPMzbdDqGHLYdh8Tw/ERR9eeuXPcHfuMt9vnd87 z9y4QB8TIcGHzcoizNEPuq15HEJcqXpHAkf7BCtr1dgE9k4PKQOtk3HZ HNfa0J2kWkpblwL5GJmLjwv9yhK1r0TnSNiuRueuaVtdnb68Qx24jfoh gBs7S1fxvulkms0bVfZcombShtIu5b6Pll7Wlef++Zqef/i9ZHCPR5b/ LjyTh2YxkeGvs9yDclRZLECvjTsQ7+V8lZQnwnnNp/JPq34DYDjGfoAF lPEg/XLsdYdNSiNa5ckSC2r0PneMpZACCJM8CHMRggFJAdh1fIxYfra0 PxnF3A==
;; Received 648 bytes from 192.33.4.12#53(c.root-servers.net) in 47 ms

agence-aurion.fr.	172800	IN	NS	dns101.ovh.net.
agence-aurion.fr.	172800	IN	NS	ns101.ovh.net.
HSE6LVEAKJI7RI5C4E8A03BFG5HA71AO.fr. 5400 IN NSEC3 1 1 1 297E821C HSE6PKPOMG50JK2DK02DRF66LR6OOQFN  NS SOA TXT NAPTR RRSIG DNSKEY NSEC3PARAM TYPE65534
HSE6LVEAKJI7RI5C4E8A03BFG5HA71AO.fr. 5400 IN RRSIG NSEC3 13 2 5400 20220927065636 20220729060347 38791 fr. VQetZeSn14w9pjVjBgxIXJSCG25ys2nngRftLzjfsWuuuZdukWRMqfqf 5NT8qdiWrolbHuXHx+nNQo3eseYyvw==
2SQ7K7R361LMH0I70Q8LK8HGE75646N1.fr. 5400 IN NSEC3 1 1 1 297E821C 2SQBPT1TMR5INJJK4HMMLNPEQMVDJUOP  NS DS RRSIG
2SQ7K7R361LMH0I70Q8LK8HGE75646N1.fr. 5400 IN RRSIG NSEC3 13 2 5400 20220927105206 20220729100457 38791 fr. vz0M/un8H2eAbt5EAksDvQmCs/tCh0wLI9yzuExgTKgtJIa21oqgnoCz TjPjtrejrajWlVV/5rX46HK8eOmKQw==
;; Received 502 bytes from 194.146.106.46#53(f.ext.nic.fr) in 37 ms

bellanger.agence-aurion.fr. 60	IN	NS	dns3.p03.nsone.net.
bellanger.agence-aurion.fr. 60	IN	NS	dns4.p03.nsone.net.
bellanger.agence-aurion.fr. 60	IN	NS	dns2.p03.nsone.net.
bellanger.agence-aurion.fr. 60	IN	NS	dns1.p03.nsone.net.
;; Received 144 bytes from 213.251.188.145#53(dns101.ovh.net) in 157 ms

bellanger.agence-aurion.fr. 20	IN	A	35.247.66.204
bellanger.agence-aurion.fr. 20	IN	A	34.83.23.240
;; Received 87 bytes from 198.51.44.67#53(dns3.p03.nsone.net) in 17 ms

I’m going to repost the section above that shows the subdomain DNS delegation:

bellanger.agence-aurion.fr. 60	IN	NS	dns3.p03.nsone.net.
bellanger.agence-aurion.fr. 60	IN	NS	dns4.p03.nsone.net.
bellanger.agence-aurion.fr. 60	IN	NS	dns2.p03.nsone.net.
bellanger.agence-aurion.fr. 60	IN	NS	dns1.p03.nsone.net.
;; Received 144 bytes from 213.251.188.145#53(dns101.ovh.net) in 157 ms

That shows the ovh.net name server saying that the name servers (NS type records) for the subdomain are the NS1 name servers (which Netlify DNS is using for DNS infrastructure).

Netlify DNS does not support subdomain delegation. The solution for this will be to delete the DNS zone here:

https://app.netlify.com/account/dns/agence-aurion.fr

and to use the external DNS instructions below instead:

Alternatively, you can move the DNS service for the domain to Netlify but that is optional and not a requirement in any way. If you want to use Netlify DNS, please be sure you have copied all existing and required DNS records to Netlify before changing the name severs for the domain at the registrar.

If there are other questions about this or if either solution above does not work, please let us know.

1 Like

Thank you, it sounds like a nice start to solve my issue, i will check that in the next few days

1 Like

Ok, so I removed the DNS from this page:

https://app.netlify.com/teams/tonyweb/dns/agence-aurion.fr

To add the dns on ovh directly :

Was that the right thing to do?

Because I always have this problem of cold start when I go on https://bellanger.agence-aurion.fr/ after a certain time the site takes several seconds to be displayed, then once displayed all the following refreshments (f5) will be instantaneous.

Hey @Tonyweb,

You need to go here: Netlify App, scroll to the end and click on “Delete DNS Zone” to get rid of that. That’s not causing trouble with this problem anymore, but it’s worth removing it anyways.

To solve the actual issue, would you mind sharing the HAR file that shows a slow load? That would help us make sure we’re all looking at the same issue.

Additionally, I can see that you’re using Nuxt 3 with Netlify Functions preset (default), and that’s probably going to be slower than the alternative Netlify Edge Functions preset. You can configure this preset by using:

nitro: {
  preset: 'netlify-edge'
}

(if I recall correctly)

That’s expected to be faster than Netlify Functions. However, last time I had used it, Nuxt.js did not work and gave me the error mentioned here:

Since the issue is still open, I am assuming it has not been fixed, but you’re free to try.