next-on-netlify function times out > 10s when deployed, renders in 0.3s locally

Viewed 514

Built with Next.js, next-on-netlify, and the page in question is using getServerSideProps.

Over an average of 10 page loads:

  • Using yarn dev (Next.js local dev), the full request takes ~1 second.
  • Using netlify dev, the full request takes < 1 second.
  • Using the Netlify function on Lambda, the full request takes ~9.5 seconds, and times out above 10 frequently.

I’ve profiled the time from the getServerSideProps call to the return of the page function, and on all environments, that reliably takes < 1 second.

I’ve also tried removing all content from the page and requests from the props, and neither has any affect on the Netlify function.

How can I profile where the bottle neck is? Is this potentially a Netlify issue?

0 Answers
Related