Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Network Engineer practice bank has an additional 2,437 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your organization runs a stateful web application behind a global external Application Load Balancer backed by autoscaled Managed Instance Groups (MIGs) running Nginx across multiple zones. Currently, the backend service uses default timeouts, UTILIZATION balancing mode, and GENERATED_COOKIE session affinity.
You observe four issues:
backend_connection_closed_before_data_sent_to_client errors.Which configuration resolves all four issues?
This configuration aligns Layer 7 session persistence, request lifecycle timeouts, TCP keepalive coordination, and zone-level traffic distribution across the global external Application Load Balancer and its Nginx backends. By replacing hash-ring-sensitive session affinity with stateful cookie-based affinity (STRONG_COOKIE_AFFINITY) and pairing it with aligned timeouts and a service load balancing policy, traffic remains resilient through autoscaling and high-latency requests.
GENERATED_COOKIE or HTTP_COOKIE, STRONG_COOKIE_AFFINITY encodes the target backend instance directly inside the Set-Cookie value. Adding or removing other instances during autoscaling does not invalidate existing clients' affinity unless their specific selected instance is removed or becomes unhealthy.--timeout) from the default 30 seconds to 120 seconds prevents the load balancer from truncating active HTTP responses. Setting --connection-draining-timeout to 120 seconds stops new connections from reaching scaled-down VMs while giving existing 90-second requests time to finish.backend_connection_closed_before_data_sent_to_client: The load balancer's backend HTTP keepalive timeout is fixed at 600 seconds. Raising Nginx's keepalive_timeout from its 75-second default to 620s ensures the proxy initiates graceful TCP FIN closure before Nginx closes the socket with a TCP RST.serviceLbPolicy with WATERFALL_BY_ZONE instructs second-layer Google Front Ends (GFEs) to strongly prefer backends in the same zone and spill to other zones only after all local-zone backends reach capacity.STRONG_COOKIE_AFFINITY imposes no restrictions on balancingMode or localityLbPolicy, working seamlessly alongside UTILIZATION or RATE.--connection-draining-timeout with an adequate --timeout protects both steady-state and terminating requests.WATERFALL_BY_ZONE maximizes local-zone consumption before utilizing remote zones.Every other session affinity mode breaks when the total number of healthy or configured backends changes during autoscaling, and default 30-second timeouts, disabled draining, or sub-600-second web server keepalives directly cause premature request failures.
This configuration correctly selects STRONG_COOKIE_AFFINITY, 120s connection draining, and WATERFALL_BY_ZONE, but leaves the backend service timeout at its 30-second default and lowers Nginx's keepalive_timeout to 580 seconds, which is shorter than the load balancer's fixed 600-second backend keepalive.
timeoutSec) governs the maximum time allowed between sending the first byte of a request and receiving the last byte of the HTTP response. Keeping the default 30 seconds causes the load balancer to drop or truncate 90-second responses even when no instance is scaling down; connection draining timeout only extends the grace period for removed VMs and does not override timeoutSec.backend_connection_closed_before_data_sent_to_client errors: The load balancer's backend HTTP keepalive timeout is fixed at 600 seconds and cannot be lowered. Configuring Nginx's keepalive_timeout to 580s creates a race condition where Nginx closes an idle TCP socket while the second-layer GFE still believes the connection is reusable, resulting in a TCP reset (RST) when the next request arrives.backend_keepalive > load_balancer_backend_keepalive (600s) so the proxy sends the TCP FIN first.timeoutSec.All HTTP responses completed in under 30 seconds and the load balancer's backend HTTP keepalive timeout were configurable below 580 seconds (which it is not).
This approach configures HTTP_COOKIE affinity with Maglev hashing (MAGLEV), switches the backend service protocol to HTTP2, sets the backend service timeout to 120s, explicitly sets connection draining to 0, raises Nginx keepalive_timeout to 620s, and relies on the default WATERFALL_BY_REGION algorithm.
HTTP_COOKIE with MAGLEV hashes a specified cookie against the current set of healthy backends. Whenever MIG autoscaling adds or removes any VM, the total number of configured or healthy backends changes, causing Maglev hashes to remap sessions to different instances.--connection-draining-timeout to 0 disables connection draining. When the autoscaler removes an instance, Google Cloud terminates existing connections as quickly as possible instead of allowing 90-second in-flight requests to finish.WATERFALL_BY_REGION algorithm only prefers the GFE's local zone at low request rates; it does not strictly exhaust all local-zone capacity before spilling to other zones the way WATERFALL_BY_ZONE does.HTTP2 overhead: Using HTTP2 between the load balancer and backends disables connection pooling, requiring significantly more TCP connections to the Nginx instances and potentially increasing backend latency.0: Zero seconds instructs the load balancer not to wait for active requests on removed VMs.HTTP2 behavior: Unlike HTTP/1.1 or HTTPS, HTTP/2 to backends does not support load balancer connection pooling.WATERFALL_BY_REGION vs. WATERFALL_BY_ZONE: Only WATERFALL_BY_ZONE strictly waits until all local-zone backends reach configured capacity before routing cross-zone.Backends were stateless with short-lived requests that clients safely retry on disconnect, backend capacity was fixed without autoscaling, and strict zone-level waterfalling was unnecessary.
This option tunes the balancing mode (RATE), consistent hashing policy (RING_HASH), request and draining timeouts (120s), and Nginx keepalive (620s), while adopting the SPRAY_TO_REGION service load balancing algorithm and retaining GENERATED_COOKIE session affinity.
UTILIZATION to RATE avoids unpredictable capacity-fullness shifts, all session affinity modes except STRONG_COOKIE_AFFINITY require the total number of configured and healthy backend instances to remain constant. Whenever a MIG autoscaler adds or removes any VM, the backend pool size changes and GENERATED_COOKIE affinity can break for clients across the pool.SPRAY_TO_REGION disables local-zone preference for second-layer GFEs, actively distributing requests across backends in all zones of the region. Rather than keeping traffic local until zone capacity is exhausted, it increases cross-zone traffic and opens connections to more distinct backends.GENERATED_COOKIE dependency on pool stability: Consistent hashing algorithms redistribute keys when the backend set expands or contracts, breaking stickiness for existing sessions.RATE balancing mode: Choosing RATE measures requests per second (or lowest average latency) and helps prevent affinity breaks caused by UTILIZATION fullness fluctuations, but it cannot prevent breaks caused by instance count changes.SPRAY_TO_REGION: Spreading load evenly across all zones improves regional load balance at the expense of higher inter-zone traffic and reduced per-backend cache locality.The backend pool size were static (no autoscaling or frequent instance replacements) and the primary goal were even regional distribution across zones rather than keeping traffic within the local GFE zone.
A common misconception is that pairing RATE balancing mode and RING_HASH makes GENERATED_COOKIE immune to autoscaling. Only stateful cookie-based affinity (STRONG_COOKIE_AFFINITY) encodes the specific backend instance directly in the cookie so unrelated scaling events do not disrupt existing client sessions.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated