Skip to content

Connection Draining

Connection Draining

  • Only supported in Classic Load Balancer (CLB)
  • gracefully disconnect the connections (ASG/EC2)
  • allows in-flight request to complete
  • timeout value: 1s - 3600s (default: 300s)
  • Timeout does not apply to failed health check
  • applies when instance taken out of ASG - manually or ASG activities
    • InService: Instance deregistraiton currently in progress
    • AS waiting for all connections to complete of timeout - whichever occur first

Registration Delay

  • Supported in ALB, NLB, GWLB - defined on the target group
  • stop sending requests to deregistration targtes
  • existing connections can continue until they complete naturally
  • enabled by default with value 300s
  • 0-3600s

X-Forwarded-For and Proxy protocol are two alternative versions of gaining visibility of original client IP address when using proxy servers or load balancers

X-Forwarded-For

  • Set of http/https headers (layer 7)
  • Header is appended or added by proxies/LB
  • Http Header -> X-Forwarded-For: client,proxy1,proxy2
  • Client is the left most in the list
  • Supported in CLB and ALB but NOT SUPPORTED IN NLB

PROXY protocol

  • Proxy protocol works at Layer 4
  • TCP header works with layer 4
    • also works with http/https
  • v1 (human readable) - CLB || v2 (binary encoded) - NLB
  • Not supported in ALB
  • Use Case -> unbroken https encryption between client and server (tcp listener)