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.

ChangeWhy
spring.threads.virtual.enabled=truecheckout waits on payment and DB; virtual threads stop Tomcat thread starvation
Hikari pool 10 → 25, timeout 30 s → 3 sfail fast instead of piling up requests
spring.jpa.open-in-view=falseconnections released before JSON is written
Product list: DTO projection + page size 20fewer columns, no N+1
Caffeine + Redis cache for product detailsDB reads drop by 99%
gzip + HTTP/285% smaller responses on mobile

Example

Load test with k6 (2,000 virtual users):

k6 run --vus 2000 --duration 5m checkout-test.js

Example 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.