How do you log and measure request latency at the proxy?
BeginnerProductionLoad Balancing, Proxies & nginx in Production
Answer
Log $request_time (total) and $upstream_response_time (backend only) in nginx, plus $upstream_connect_time. The difference shows client or proxy delay versus backend delay. For ALB, access logs give request_processing_time, target_processing_time and response_processing_time.
Export histograms (not averages) and watch p95 and p99. Averages hide tail problems.
More on Load Balancing, Proxies & nginx in Production
How do you choose between ALB, NLB and an nginx or Envoy fleet?IntermediateHow do you tune ALB idle timeout and backend keep-alive to avoid 502s?IntermediateWhich nginx directives matter most for a production reverse proxy?IntermediateHow do you do rate limiting and abuse protection in nginx?IntermediateHow do you achieve zero-downtime configuration reloads in nginx and HAProxy?IntermediateHow would you design a highly available load-balancing tier on-prem or in a colo?Advanced