Indrani Infrastructure: Analyzing the Next.js E-Commerce Stress Test
Testing your infrastructure under heavy concurrent load is critical for enterprise scale. Discover how the Indrani Jewelers platform achieved a zero percent failure rate during our rigorous Next.js e-commerce stress test.
https://www.indranijewells.com) to a rigorous, high-concurrency e-commerce stress test to identify our architectural bottlenecks, measure our latency percentiles, and ensure the operational defense layer remains stable under immense pressure. 1. The Baseline: Achieving a Zero Percent Failure Rate
During the sustained load test, the platform processed 35.29 requests per second. Over the duration of the test, the infrastructure handled 35,836 successful
2xx HTTP requests and 572 3xx redirects. - 0.00% HTTP failures
- 0.00% Unexpected statuses
- 0
4xx(Client Errors) - 0
5xx(Server Errors / Timeouts) - 0
429(Too Many Requests / Rate Limiting) - 0
403(Forbidden)
Achieving a 0.00% failure rate under a sustained load of 35+ requests per second is a massive victory for a serverless Next.js deployment. In typical monolithic architectures, this level of concurrency often exhausts the MySQL or PostgreSQL database connection pools, leading to a cascade of
500 Internal Server Error or 504 Gateway Timeout responses. 429 Too Many Requests indicates that our API routing and external data providers are not aggressively throttling our serverless functions. Furthermore, the lack of 5xx errors proves that our database connection management (likely utilizing a connection pooler like Prisma Accelerate or Supabase PgBouncer) is correctly queuing and resolving queries without dropping connections. The infrastructure is highly resilient.2. Scenario Latency Breakdown
| Scenario | Avg Latency | P95 Latency | Max Latency |
|---|---|---|---|
| Homepage | 206 ms | 603 ms | 3609 ms |
| Search | 795 ms | 1116 ms | 4771 ms |
| Collection | 735 ms | 1124 ms | 4910 ms |
| Product | 973 ms | 1392 ms | 5692 ms |
| Account | 313 ms | 649 ms | 3669 ms |
| Cart | 164 ms | 442 ms | 2101 ms |
| Checkout | 160 ms | 455 ms | 2245 ms |
| Blog | 961 ms | 1348 ms | 2644 ms |
| Bespoke | 205 ms | 558 ms | 2280 ms |
| Admin | 195 ms | 496 ms | 2314 ms |
3. The Critical Funnel: Lightning Fast Cart & Checkout
- Cart: 164 ms (Avg) / 442 ms (P95)
- Checkout: 160 ms (Avg) / 455 ms (P95)
In standard e-commerce platforms like WooCommerce or Magento, the cart and checkout routes are notoriously the slowest pages. This is because they must bypass static caching to dynamically calculate shipping rates, taxes, and real-time inventory levels.
4. The Dynamic Bottleneck: Products, Collections, and Search
- Search: 795 ms (Avg) / 1116 ms (P95)
- Collection: 735 ms (Avg) / 1124 ms (P95)
- Product: 973 ms (Avg) / 1392 ms (P95)
- Blog: 961 ms (Avg) / 1348 ms (P95)
While the checkout flow is heavily optimized, the content and discovery phases of the application represent our primary performance bottleneck. The global P95 latency is 1203 ms, and this is almost entirely driven by the Product and Search scenarios.
LIKE operators or heavy full-text search indexing—that consume significant compute time. To resolve this, we must shift these workloads to the edge network.
- Implement ISR for Products: Product pages should utilize Next.js
revalidatetags. The HTML should be cached globally at the edge and revalidated in the background only when inventory or pricing actually changes. This will drop the 973ms latency to match the Homepage (206ms). - Decouple Search: Move the search logic away from direct database queries and integrate a dedicated search index like Algolia, Typesense, or Meilisearch, which can return sub-50ms results.
5. Securing the Operational Defense Layer: Admin & Bespoke
- Admin: 195 ms (Avg) / 496 ms (P95)
- Bespoke: 205 ms (Avg) / 558 ms (P95)
- Account: 313 ms (Avg) / 649 ms (P95)
The Indrani Jewelers platform is more than just a storefront; it operates as a sophisticated operational defense layer for the business, handling inventory tracking, custom bespoke orders, and administrative tasks.
Admin and Bespoke scenarios maintained average latencies of roughly 200 ms during a heavy stress test. This means that even while the public storefront was being hammered with 35 requests per second, the internal operational tools remained highly responsive for the staff. The backend architecture successfully isolates standard e-commerce traffic from internal administrative queries, ensuring that sudden traffic spikes do not paralyze the business's day-to-day operations.6. Understanding Maximum Latency Spikes (Cold Starts)
- Product Max: 5692 ms
- Collection Max: 4910 ms
- Search Max: 4771 ms
7. Next Steps: Engineering for Scale
- Aggressive Cache Strategies: Transition the
/product/[slug],/collection/[slug], and/blog/[slug]routes to utilize Next.js Incremental Static Regeneration (ISR). We must stop querying the database on every single page load. - Streaming React Server Components: For dynamic data that cannot be cached (like personalized recommendations on a product page), implement React
Suspenseboundaries. Send the static HTML layout instantly, and stream the heavy database queries in the background. - Search Indexing: Offload the
/searchendpoint to a dedicated, memory-based search engine to prevent heavy analytical queries from slowing down the primary transactional database.
💡 Key Engineering Takeaways
Frequently Asked Questions
What does a 0.00% HTTP failure rate actually mean during a stress test?
It means that out of over 35,000 automated requests fired at the server, not a single one was dropped, timed out, or resulted in a server crash. The hosting infrastructure successfully caught, processed, and returned data for every single incoming connection, proving the architecture is highly stable.
Why is the Product page latency significantly higher than the Checkout latency?
In this specific architecture, the checkout is highly optimized—likely processing quickly on the client-side or utilizing fast edge functions. The product page, however, is likely Server-Side Rendered (SSR). It takes time (average 973ms) for the server to query the database for product details, images, variants, and stock levels before generating the page.
What is P95 latency and why does it matter more than the average?
P95 latency means that 95% of all requests were completed in that time or faster. While an average can be skewed by a few incredibly fast requests, the P95 metric gives a much more realistic picture of what the vast majority of your actual human users are experiencing during heavy traffic.
How can we fix the 5-second maximum latency spikes?
Those massive spikes are caused by "serverless cold starts"—the time it takes for the hosting provider to boot up a brand new server instance to handle a sudden surge in traffic. You can reduce this by optimizing your backend bundle size, using Vercel's Edge network, or utilizing Incremental Static Regeneration (ISR) to serve cached files instead of booting functions.
Is 35 requests per second considered high traffic?
Yes. While it may not sound massive, 35 requests per second equates to roughly 3 million requests per day. For a customized e-commerce platform processing dynamic transactions, inventory checks, and search queries, handling this without a single dropped connection is an excellent baseline performance metric.
Feedback
Was this article helpful?
Related Engineering Diaries
Building 82 Pages in 49 Seconds: What Actually Made the Difference
Stop wasting expensive CI/CD minutes on slow deployments. Discover seven proven architectural secret...
Why My Green Vercel Deployment Returned a 404
Vercel displayed a green deployment success badge, but my live production URL returned a pristine 40...
Fixing Phantom 404s: The 2000ms Database Timeout Trap
Intermittent 404 errors and fetch failures during Next.js builds can be maddening. Discover how incr...
