4+ seconds waiting for server response

I’m doing some framework and hosting testing, deploying the same site across different platforms and noticed that my site https://thelilywhites.netlify.app/ takes 4+ seconds to do anything, I suspect it’s a configuration thing but the code itself is pretty basic so I wouldn’t expect it to take 4 seconds for the server to respond?

I’m seeing a TTFB of 600ms:

Mind sharing a HAR file?

Thanks for the reply, I’d love to, but I get the message ‘Sorry, new users can not upload attachments.’

HAR shows:

Request times
Long server processing time

The server took a long time to respond. This may indicate some overload or problem in the server side

DNS time
83 ms
Connection time
59 ms
Send time
0 ms
Wait time
5312 ms
Receive time
0 ms
SSL time
72 ms

Hi, @twentynine12. We cannot see what your function code is spending time on. Either the function logs the reason for the slowness or it does not. If it does not, we don’t have any special or secret way to debug it.

We recommend adding console.log() and console.time() calls around any API calls or HTTP requests the function makes to get a better understanding of where is spends most of its time to find out the cause of the slowness.

Hi @luke , there aren’t any API calls or requests, it gets dummy data from json files.

I’ve now removed everything from the page apart from an h1 still get the same slowness. Not a clue what’s happened.

We are also seeing slowness on all of our sites (which use Next.js), such as v3.lumanu.link

The server returns the HTML to the browser in well under a second, but static files are taking 15-30 seconds to fetch. These include css files, fonts, js chunks for Next.js.

Same here, it is very slow with just a page returning a h1.

I understand, but that code is still executing on the AWS Lambda side of things and it’s not something Netlify controls. You can see here:

The Lambda duration took 5 seconds. You can read more about it here: Working with Lambda function metrics - AWS Lambda (amazon.com)

The code that executes there is user+framework+dependencies. Netlify simply bundles the code into a Lambda-compatible zip and sends it over there. How long it takes to execute on AWS is not something we have control over.

@ProjectFrank, your site seems to be behind a login, so we can’t check that. If you have some test credentials to check, let us know.

@jebenois, unless we have a site to check, we can’t do anything about a slow site report.

@hrishikesh Hi, again, thanks for your input.

I’ve solved my very specific Remix issue, when I’d created the project I’d used the remix / netlify template there were 2 options around which Netlify functions to use, either ‘Netlify Functions’ or ‘Netlify Edge Functions’. I’d chosen Netlify Functions initially which when deployed was working but with a 4-5 second initial delay even with no logic.

I switched the site to using Edge Functions and it works absolutely fine, it takes 66ms now instead of 5000+.

Thanks to you and @luke for your assistance.