Performance monitoring
Next.js performance monitoring
Next.js performance has two halves: the browser (Web Vitals) and the server (rendering, data fetching, caching). Monitor both and connect them.
3 min read8 sectionsUpdated
On this page
| Metric | Good | Typical Next.js cause when poor |
|---|---|---|
| LCP | ≤ 2.5 s | Client-side rendering of the first screen, large bundles, late hero images |
| INP | ≤ 200 ms | Expensive re-renders, heavy event handlers, long tasks during hydration |
| CLS | ≤ 0.1 | Content inserted after data loads, images without dimensions |
| JS error rate | Low and stable | Unhandled errors in components and async code |
Common Next.js performance problems
- Dynamic rendering where static would do: a single
cookies()orheaders()call can make a route dynamic and raise TTFB. - Waterfalls of server fetches that could run in parallel with
Promise.all. - Client components too high in the tree, shipping large bundles for mostly static pages.
- Unoptimized images without
next/imagesizing, or the LCP image lazy-loaded. - Third-party scripts loaded eagerly; use the Script component's strategies.
Measuring
On the server, Next.js emits OpenTelemetry spans for requests, rendering and route handlers; register an SDK in instrumentation.ts and export them (OpenTelemetry for Next.js). In the browser, measure Web Vitals from real users per route. Compare TTFB from real users with server render time from traces to see whether the time is in your code or in the network and cache.
Next.js monitoring in VitalRix
Add the real user monitoring script to your app shell to record Core Web Vitals per page from real visitors, JavaScript errors with source-mapped stacks (upload source maps per release), and masked session replays. Pair it with APM for the API calls your Next.js app makes, and try the free LCP and INP checks on any page.
Does real user monitoring work with Next.js client-side routing?
Yes. Page views are recorded on navigation, and Web Vitals such as INP and CLS are measured across the visit.
Why is my Next.js TTFB high only sometimes?
Usually cache misses or cold starts: a cached page is fast, a miss renders on demand. Traces show render time per request; check revalidation settings.
Check it now, free
- Response time checker: Measure TTFB with DNS, connect, TLS and server time.
Related reading
- How to monitor a Next.js app: How to monitor a Next.js app in production: uptime checks, Core Web Vitals, server and edge errors, OpenTelemetry traces for SSR and API routes, and alerts.
- React performance monitoring: Monitor React apps in production: Core Web Vitals from real users, slow renders and INP, bundle size, errors with source maps.
- Vue performance monitoring: Monitor Vue and Nuxt apps in production: Core Web Vitals from real users, reactivity and render cost, bundle size.
- Angular performance monitoring: Monitor Angular apps in production: Core Web Vitals from real users, change detection cost, bundle size and lazy loading, errors with source maps.
- Monitoring for publishers and media sites: Monitoring for news and content sites: Core Web Vitals per template, layout shift from ads, breaking-news traffic spikes and crawlability checks.
- OpenTelemetry for Flask: Instrument a Flask app with OpenTelemetry, in code or with zero code: trace routes, SQLAlchemy and outgoing calls, and export to VitalRix.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.