Careeroza
Real World Example
Tuning ShopEase for a Flash Sale
Before a big sale, teams at companies like Myntra and Nykaa load-test and tune each service. Here is a realistic before/after for ShopEase's product and checkout APIs on 4 instances.
| Change | Why |
|---|---|
spring.threads.virtual.enabled=true | checkout waits on payment and DB; virtual threads stop Tomcat thread starvation |
| Hikari pool 10 → 25, timeout 30 s → 3 s | fail fast instead of piling up requests |
spring.jpa.open-in-view=false | connections released before JSON is written |
| Product list: DTO projection + page size 20 | fewer columns, no N+1 |
| Caffeine + Redis cache for product details | DB reads drop by 99% |
| gzip + HTTP/2 | 85% smaller responses on mobile |
Example
Load test with k6 (2,000 virtual users):
k6 run --vus 2000 --duration 5m checkout-test.jsExample output
before after http_req_duration p95=2.8s p95=310ms http_req_failed 6.20% 0.04% http_reqs 1,240/s 5,980/s hikari pending (max) 180 3
Tip: Change one thing at a time and measure. Use Actuator metrics and Grafana during the test to find the real bottleneck.