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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cold Start Issue in NextJS application #3993

Open
3 tasks done
vjjcn opened this issue Feb 14, 2025 · 3 comments
Open
3 tasks done

Cold Start Issue in NextJS application #3993

vjjcn opened this issue Feb 14, 2025 · 3 comments

Comments

@vjjcn
Copy link

vjjcn commented Feb 14, 2025

Before opening, please confirm:

Amplify Hosting feature

Deployments, Frontend builds

Is your feature request related to a problem? Please describe:

Hello Community,

Lot of users in amplify are facing the issue in which the website takes more than 3-4 seconds to load because of the cold start, It makes UI experience of the application bad, some users might drop of the website because of the cold start.

Describe how you'd like this feature to work

I request you to improve the coldstart of the website which typically takes 3-4 seconds and make the UI experience of the Amplify better.

@vjjcn vjjcn added the feature-request New feature or request label Feb 14, 2025
Copy link

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

@mauerbac
Copy link
Member

Can you provide more info about your app? Like versions and provide a screencapture?

@mauerbac mauerbac removed the feature-request New feature or request label Feb 23, 2025
@kachkaev
Copy link

kachkaev commented Feb 24, 2025

Same issue here. Cold start takes more than five seconds. To me as a user, it feels forever. Just tried opening our team’s app on Monday morning and it took 7.08 seconds. It’s a B2B SaaS with low traffic so the probability of hitting cold instance is quite high.

Our stack:

I was thinking of running a cron job in CI that would fetch from Amplify once in 5-10 minutes. This might keep the app warm during business hours to avoid cold starts. But this is a pretty hacky solution to something that should work out of the box anyway. Not sure if constant artificial pre-warming would affect our bill. I hope to see some official guidance in Amplify docs.


UPD: tried opening a client-facing instance of our Amplify app (deployed from a different branch to a different domain). It took 14.84 seconds to make a cold request to /. Total time to login screen was over 16 seconds!

Image

When refreshed (even without browser cache), loading is quite fast. Getting to the same <Autenticator> screen in under a second when Amplify is warm. I am in the same region, so makes sense. The initial request to / was only 137ms (100+ times faster than the cold one!).

Image

I can reliably reproduce the above delay if nobody is visiting the website for more than 5-10 mins. It’s not a one-off thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants