Curated

Troubleshooting and Optimization (4.1–4.3)

0 votes

Questions66

  1. Question 51

    Troubleshooting and Optimization

    What is the purpose of sampling requests when collecting distributed traces with AWS X-Ray?

    Show the answer

    Correct answerA. To control the volume of requests recorded as traces

    AWhy this is right: Sampling selects a subset of requests to reduce tracing overhead and data volume.

    BWhy not this: Health checks assess availability or readiness, not trace collection volume.

    CWhy not this: Metric publication produces measurements; sampling selects requests for tracing.

    DWhy not this: Log organization is separate from deciding which requests produce traces.

    Sampling controls how many requests are traced, balancing observability with collection overhead and cost. Health checks assess endpoint availability rather than selecting requests for tracing.

    Open this question
  2. Question 52

    Troubleshooting and Optimization

    An Application Load Balancer routes requests to an EC2 application, and users report slow responses. Which CloudWatch metric should the developer inspect to determine whether targets are slow to begin responding?

    Show the answer

    Correct answerA. TargetResponseTime

    AWhy this is right: This metric measures the time until a target begins sending response headers.

    BWhy not this: Load-balancer-generated server errors do not measure target response latency.

    CWhy not this: Healthy target counts indicate availability rather than response timing.

    DWhy not this: Request volume can explain increased load but does not measure how quickly targets respond.

    TargetResponseTime measures the interval from sending a request to a target until the target starts sending response headers. RequestCount measures traffic volume, which can correlate with slowdowns but does not measure target response latency.

    Open this question
  3. Question 53

    Troubleshooting and Optimization

    Which Amazon SQS CloudWatch metric indicates how long the oldest unprocessed message has been waiting?

    Show the answer

    Correct answerA. ApproximateAgeOfOldestMessage

    AWhy this is right: It reports the age in seconds of the oldest unprocessed message.

    BWhy not this: It estimates in-flight messages that have been received but not yet deleted.

    CWhy not this: It estimates the number of messages available for retrieval, not their age.

    DWhy not this: It counts messages returned by receive operations, not time spent waiting.

    ApproximateAgeOfOldestMessage reports the age of the oldest unprocessed message, helping reveal processing delays. ApproximateNumberOfMessagesVisible measures available backlog size rather than waiting time.

    Open this question
  4. Question 54

    Troubleshooting and Optimization

    An API on Amazon ECS shows rising p99 latency while CPU utilization and the SQL execution times in its AWS X-Ray traces stay low. Slow traces show a long gap before the first database call, and the application's connection pool stays at its limit. Which action BEST confirms whether requests are waiting for pooled connections?

    Show the answer

    Correct answerA. Add an X-Ray subsegment around connection acquisition and publish pending pool requests as a CloudWatch custom metric.

    AWhy this is right: Timing connection acquisition in X-Ray and graphing pending pool requests in CloudWatch directly measures the suspected wait.

    BWhy not this: Averages hide p99 behavior, and an open-connection count already at its limit cannot separate waiting from other application work.

    CWhy not this: Sampling more requests still measures only SQL execution, not the time spent before a connection is obtained.

    DWhy not this: Database CPU is already low, so finer database metrics do not reveal time spent waiting inside the application.

    An X-Ray subsegment around connection acquisition makes the wait for a pooled connection visible in each trace, and a CloudWatch custom metric for pending pool requests shows contention across all requests. More SQL samples, database CPU or average latency still leave the time before a connection is acquired unmeasured.

    Open this question
  5. Question 55

    Troubleshooting and Optimization

    CloudFront serves product pages whose content varies by the language query parameter but not by the tracking query parameter. Both parameters must reach the origin on cache misses; how should the developer configure caching to prevent language mixing and maximize reuse?

    Show the answer

    Correct answerB. Include language in the cache policy and forward tracking through an origin request policy.

    AWhy not this: Separating entries by tracking value unnecessarily reduces cache reuse.

    BWhy this is right: Language separates cached representations, while tracking reaches the origin without fragmenting the cache.

    CWhy not this: Tracking fragments the cache while language fails to distinguish cached representations.

    DWhy not this: Forwarding parameters does not make them part of the cache key, so different languages could share an entry.

    The cache key must distinguish languages without creating separate entries for tracking values. An origin request policy can forward tracking without adding it to the key; forwarding language alone would not prevent different languages from sharing cached content.

    Open this question
  6. Question 56

    Troubleshooting and Optimization

    An application on Amazon EC2 slows during peak traffic, but default CloudWatch metrics show low CPU utilization. The developer suspects memory pressure; what should the developer do to collect the missing evidence?

    Show the answer

    Correct answerC. Configure the CloudWatch agent to publish memory metrics.

    AWhy not this: CPU-based scaling changes capacity without collecting evidence about memory utilization.

    BWhy not this: Flow logs describe network traffic, not application memory pressure.

    CWhy this is right: The agent collects operating system memory metrics needed to investigate memory pressure.

    DWhy not this: Detailed monitoring increases metric frequency but does not collect guest operating system memory utilization.

    The CloudWatch agent can collect guest operating system memory metrics, which default EC2 monitoring does not provide. Detailed monitoring increases the frequency of supported EC2 metrics but does not add guest memory utilization.

    Open this question
  7. Question 57

    Troubleshooting and Optimization

    An application sends traces to AWS X-Ray and records a customer tier as segment metadata. Developers must filter traces by customer tier in X-Ray filter expressions; what should they change?

    Show the answer

    Correct answerC. Record customer tier as an annotation.

    AWhy not this: Metric dimensions identify metric time series, not searchable attributes on X-Ray traces.

    BWhy not this: Sampling more requests increases trace coverage but does not make metadata searchable.

    CWhy this is right: Annotations are indexed attributes that X-Ray filter expressions can query.

    DWhy not this: Structured logs support log queries, not filtering traces by an indexed segment attribute.

    X-Ray indexes annotations so they can be used in trace filter expressions. Metadata can hold additional trace details but is not indexed for filtering; increasing sampling does not change that.

    Open this question
  8. Question 58

    Troubleshooting and Optimization

    An Amazon EKS application briefly cannot serve requests while refreshing its local cache, but restarting it would delay recovery. Which probe should fail during the refresh to stop Kubernetes Service traffic without restarting the container?

    Show the answer

    Correct answerC. A readiness probe

    AWhy not this: A startup probe gates initial startup checks, not temporary unavailability after startup.

    BWhy not this: EC2 status checks assess instance health, not whether a Pod can currently serve application requests.

    CWhy this is right: Readiness failures stop Service traffic to the Pod while allowing the container to continue running.

    DWhy not this: Liveness probe failures can restart the container rather than merely stop incoming Service traffic.

    A failed readiness probe removes the Pod from eligible Service endpoints without restarting its container. Liveness failures can trigger restarts, which would delay recovery here.

    Open this question
  9. Question 59

    Troubleshooting and Optimization

    An Amazon EKS container needs 30–180 seconds to initialize, and its liveness endpoint fails until initialization finishes. After initialization, deadlocks must trigger a restart within approximately 30 seconds; which configuration meets both requirements without imposing a fixed 180-second delay on every start?

    Show the answer

    Correct answerC. Use a startup probe with a 180-second budget, then a liveness probe with a 30-second failure window.

    AWhy not this: Readiness failures control traffic eligibility but do not restart a deadlocked container.

    BWhy not this: A long liveness failure window tolerates startup but also delays detection of deadlocks after startup.

    CWhy this is right: The startup probe protects initialization and enables the short liveness failure window as soon as startup succeeds.

    DWhy not this: A fixed initial delay postpones liveness checks for the full interval even when initialization finishes early.

    A startup probe suppresses liveness checks until startup succeeds, allowing variable initialization times. Liveness can then use a short failure window; a fixed initial delay postpones detection even when startup finishes quickly.

    Open this question
  10. Question 60

    Troubleshooting and Optimization

    An Application Load Balancer checks a static page that returns HTTP 200 even when an individual target loses access to a database required for every request. What should developers change to detect this target's inability to serve requests?

    Show the answer

    Correct answerC. Check an endpoint that verifies database access.

    AWhy not this: More frequent checks cannot detect a failure that the static page does not test.

    BWhy not this: Logs help diagnose failures but do not change what the load balancer's health check evaluates.

    CWhy this is right: A dependency-aware endpoint can report failure when the target cannot perform required database operations.

    DWhy not this: Tracing a static page does not make that page verify database availability.

    A health endpoint should test the capabilities required to serve requests and return a failure status when they are unavailable. Checking a static page more frequently still cannot reveal loss of database access.

    Open this question
  11. Question 61

    Troubleshooting and Optimization

    Which Amazon CloudWatch feature runs scheduled scripts that simulate user interactions to check an application's availability?

    Show the answer

    Correct answerA. CloudWatch Synthetics canaries

    AWhy this is right: Canaries execute scheduled checks that simulate user actions and measure application availability.

    BWhy not this: Dashboards visualize operational data rather than execute scheduled user workflows.

    CWhy not this: Metric streams continuously deliver metric data rather than run application checks.

    DWhy not this: Logs Insights queries existing log records rather than executing application interactions.

    CloudWatch Synthetics canaries run scheduled scripts that check endpoints and user workflows. Dashboards display observations but do not execute simulated interactions.

    Open this question
  12. Question 62

    Troubleshooting and Optimization

    An application intermittently slows while several AWS resources show unusual behavior. The developer needs machine learning to group related anomalies into operational insights with recommendations. Which service BEST meets this need?

    Show the answer

    Correct answerA. Amazon DevOps Guru

    AWhy this is right: DevOps Guru identifies abnormal operational behavior and groups related anomalies into actionable insights.

    BWhy not this: X-Ray traces request paths and latency rather than providing this operational anomaly-grouping capability.

    CWhy not this: Dashboards visualize selected metrics but do not themselves correlate anomalies into machine learning-generated operational insights.

    DWhy not this: Compute Optimizer focuses on resource configuration recommendations rather than grouping operational anomalies.

    Amazon DevOps Guru uses machine learning to identify anomalous operational behavior and group related anomalies into insights with recommendations. AWS X-Ray helps trace requests and locate latency, but that is different from automatically grouping operational anomalies into insights.

    Open this question
  13. Question 63

    Troubleshooting and Optimization

    A developer uses CloudWatch anomaly detection to identify unusual application latency despite predictable daily traffic changes. Which statements describe how to configure or use this capability? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. Exclude a known incident period from model training.D. Use a model that accounts for recurring daily patterns.E. Configure an alarm for values outside the expected band.

    AWhy this is right: Training exclusions prevent a known abnormal period from influencing the expected-behavior model.

    BWhy not this: An expected-value band describes metric behavior; it is not a resource-sizing recommendation.

    CWhy not this: Metric model training does not inspect source code or attribute runtime costs to individual methods.

    DWhy this is right: Anomaly detection models recurring patterns so predictable daily changes can remain within expected behavior.

    EWhy this is right: An anomaly detection alarm can evaluate whether a metric falls outside its expected band.

    CloudWatch anomaly detection models expected metric behavior, including recurring patterns, supports training exclusions, and can supply an expected band for alarms. Its bands identify unusual metric values; they do not recommend instance sizes or locate inefficient methods.

    Open this question
  14. Question 64

    Troubleshooting and Optimization

    AWS Compute Optimizer recommends downsizing an EC2 instance, but the application holds a large dataset in memory and no memory metrics are available. What should the developer do before accepting the recommendation?

    Show the answer

    Correct answerB. Publish memory utilization through the CloudWatch agent and reassess.

    AWhy not this: A stronger savings preference does not resolve the missing memory utilization evidence.

    BWhy this is right: Guest memory metrics let Compute Optimizer account for the application's memory requirements.

    CWhy not this: Detailed monitoring does not collect guest operating system memory utilization.

    DWhy not this: Adding instances does not supply the missing memory data needed to evaluate the proposed instance size.

    The CloudWatch agent can supply memory utilization that Compute Optimizer can incorporate into EC2 recommendations. EC2 detailed monitoring increases the frequency of supported EC2 metrics but does not add guest memory utilization.

    Open this question
  15. Question 65

    Troubleshooting and Optimization

    A Java service becomes CPU-bound only under production traffic, and static code inspection has not identified the cause. The developer needs automated recommendations based on which methods consume runtime CPU. Which approach BEST meets this need?

    Show the answer

    Correct answerA. Collect runtime profiles with Amazon CodeGuru Profiler.

    AWhy this is right: CodeGuru Profiler analyzes runtime method activity and can recommend improvements for detected code inefficiencies.

    BWhy not this: Request traces reveal service and segment latency rather than sampled CPU consumption by application method.

    CWhy not this: Metric anomaly detection identifies unusual CPU levels, not the methods consuming CPU.

    DWhy not this: Instance recommendations address resource sizing rather than identifying CPU-intensive application methods.

    Amazon CodeGuru Profiler analyzes runtime profiles to identify expensive code paths and provide optimization recommendations. Compute Optimizer can recommend resource configurations, but it does not identify the methods responsible for CPU consumption.

    Open this question
  16. Question 66

    Troubleshooting and Optimization

    Which AWS generative AI assistant can explain application code and suggest ways to improve its efficiency?

    Show the answer

    Correct answerD. Kiro

    AWhy not this: ElastiCache provides in-memory caching rather than generative AI code assistance.

    BWhy not this: Compute Optimizer analyzes resource utilization to recommend configurations, not application code revisions.

    CWhy not this: CloudWatch provides observability capabilities rather than serving as the named generative AI development assistant.

    DWhy this is right: Kiro provides generative AI assistance for understanding and improving application code.

    Kiro, the AWS AI-assisted IDE and agent, can explain application code and suggest efficiency improvements. AWS Compute Optimizer recommends resource configurations rather than explaining and revising application logic.

    Open this question