Courseiva
Continuous Improvement for Existing SolutionshardMultiple ChoiceObjective-mapped

SAP-C02 Continuous Improvement for Existing Solutions Practice Question

A company runs a stateful web application on EC2 instances behind an Application Load Balancer (ALB). The application uses WebSockets for real-time communication. During scale-in events, users experience disconnections. How can the company maintain WebSocket connections during scaling?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Enable connection draining on the ALB target group.

Connection draining on the ALB target group allows existing WebSocket connections to complete before the instance is terminated, preventing disconnections during scale-in. Option A is wrong because an NLB is not required for WebSockets; ALB supports WebSocket connections. Option B is wrong because sticky sessions alone do not prevent disconnections during scale-in. Option D is wrong because lifecycle hooks can delay termination but do not handle existing connections; connection draining is specifically designed for this purpose.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Replace the ALB with a Network Load Balancer (NLB).

    Why it's wrong here

    NLB supports WebSockets but still requires connection draining.

  • Use sticky sessions (session affinity) on the ALB.

    Why it's wrong here

    Sticky sessions route users to the same instance but do not prevent disconnections when the instance is terminated.

  • Enable connection draining on the ALB target group.

    Why this is correct

    Connection draining allows existing connections to complete before the instance is deregistered.

  • Use an Auto Scaling lifecycle hook to delay instance termination.

    Why it's wrong here

    Lifecycle hooks delay termination but do not drain connections from ALB.

About these practice questions

One of 1,660 original SAP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SAP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAP-C02 exam.