Skip to content

High TTFB for NextJs application #3357

Description

@Akhilesh-aarzoo

Before opening, please confirm:

  • I have checked to see if my question is addressed in the FAQ.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

App Id

dyyv7k61mxhcc

AWS Region

us-east-1

Amplify Hosting feature

Not Applicable

Describe the bug

We have a NextJs application hosted on Amplify. We are seeing high TTFB for our application in production. We are getting this problem without any changes at our end. This is happening since 2:30 AM UTC today.

Expected behavior

TTFB should not take so long. It should be back to normal.

Reproduction steps

  1. Deploy a NextJs app on Amplify on us-east-1
  2. Use the hosted application URL on browser and check the Network tab

Build Settings

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - yarn install
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'

Log output

Details
# Put your logs below this line


Additional information

No response

Activity

  1. rebeccatay92 commented on Mar 8, 2023

    @rebeccatay92

    Can confirm this is happening on our Amplify applications as well, starting this morning. Vanilla React is ok but NextJS applications hv high TTFB (sometimes > 20s)
    App Id d1bzv6vd8539jw
    AWS Region us-east-1

  2. self-assigned this
    on Mar 8, 2023
  3. ArianHamdi commented on Mar 8, 2023

    @ArianHamdi

    Same here also.

  4. Akhilesh-aarzoo commented on Mar 9, 2023

    @Akhilesh-aarzoo
    Author

    @hloriana - Why are we seeing high TTFB all of a sudden? We didn't make any code changes/deployments. Did something change in AWS Amplify yesterday?

  5. ferdingler commented on Mar 9, 2023

    @ferdingler
    Contributor

    We are looking into this

  6. timedtext commented on Mar 11, 2023

    @timedtext

    @ferdingler Please take a look at my discovery. #3359 (comment)

  7. jbreemhaar commented on Mar 14, 2023

    @jbreemhaar

    @ferdingler Please have a look at #3211.
    Issues for me started since migrating WEB_COMPUTE two days ago.
    image

  8. ArianHamdi commented on Mar 14, 2023

    @ArianHamdi

    @ferdingler Please have a look at #3211. Issues for me started since migrating WEB_COMPUTE two days ago. image

    High TTFB in 03/08 & 03/09
    image

  9. ghost removed on Mar 17, 2023
  10. Akhilesh-aarzoo commented on Mar 22, 2023

    @Akhilesh-aarzoo
    Author

    It's been more than 2 weeks and there is no update here.
    This is the support we get for production issues (production system going down)? Or is this the AWS way to make us subscribe to their Support plan?

  11. isaac1400 commented on Mar 24, 2023

    @isaac1400

    In my company we are also experiencing long load times for our nextjs apps.

  12. jbreemhaar commented on Mar 28, 2023

    @jbreemhaar

    I've (temporarily) fixed this by setting up a Cloudwatch Synthetic Canary, which fetches the url of my amplify app(s) every 5 minutes and so keeps the Lambdas warm.

    Cloudwatch > Application monitoring > Synthetics Canaries where you can pick the Heartbeat monitoring blueprint.

  13. soplan commented on Mar 28, 2023

    @soplan

    I've (temporarily) fixed this by setting up a Cloudwatch Synthetic Canary, which fetches the url of my amplify app(s) every 5 minutes and so keeps the Lambdas warm.

    Cloudwatch > Application monitoring > Synthetics Canaries where you can pick the Heartbeat monitoring blueprint.

    This will only solve the issue if you do not have a high traffic website. If 2 people simultaneously access your website, one of them would still experience a cold start

  14. benjibenoit commented on Apr 17, 2023

    @benjibenoit

    Same problem here ! ~5s TTFB

  15. abepuentes commented on Apr 21, 2023

    @abepuentes

    Here is around 10s TTFB

  16. Jay2113 commented on May 3, 2023

    @Jay2113
    Contributor

    Hey everyone 👋 , thank you for your continued patience.

    We are actively investigating and are working on narrowing down the root cause of the elevated latencies (high TTFB) with Compute apps. Please rest assured that this is our highest priority and we will keep you posted with any updates.

    Apologies for the inconvenience caused due to this behavior with Compute apps.

  17. calavera commented on Jul 27, 2023

    @calavera
    Contributor

    Hey everyone 👋

    We just released some changes to improve how long it takes to serve content from Next.js apps. These changes require a new deploy in your application to take effect. The expected outcome is that your sites should load quicker than before.

    If you have comments or questions don't hesitate to reach us via AWS support.

  18. github-actions commented on Jul 27, 2023

    @github-actions

    ⚠️COMMENT VISIBILITY WARNING⚠️

    Comments on closed issues are hard for our team to see.
    If you need more assistance, please open a new issue that references this one.

  19. github-actions commented on Jul 27, 2023

    @github-actions

    This issue has been automatically locked.

  20. locked and limited conversation to collaborators on Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions