A Java Lambda that generates rare monthly utility reports shows multi-second cold starts when the first citizen clicks after long idle periods. Idle cost is a concern for infrequent use. What is the most appropriate performance approach?
Select an answer to reveal the explanation.
Short Explanation
Cold starts on a sleepy monthly report feel like waiting for a library printer to wake up. Fix the package and runtime first; buy provisioned concurrency only if the SLA truly needs always-warm capacity. Zero reserved concurrency just blocks everyone.
Full Explanation
A Java Lambda that generates rare monthly utility reports and shows multi-second cold starts after long idle periods should apply justified cold-start tactics matched to how rarely the report runs: provisioned concurrency only where the SLA requires it, reduce package weight, or reconsider a lighter runtime. Infrequent municipal reports often tolerate a slower first click; paying for always-warm capacity may be wasteful. If leadership mandates snappy first-byte times even after idle months, provisioned concurrency or a scheduled warmer becomes justifiable—and should be costed explicitly.
Setting reserved concurrency to zero so clicks queue indefinitely behind throttles creates availability failures, not performance wins. Replacing the function with a CloudWatch alarm description that claims success falsifies operations. Ignoring init duration and memory metrics while shipping the same heavy Java package unchanged refuses the performance-engineering loop.
Exam caveat: provisioned concurrency costs money whether or not citizens click—use it for latency SLOs, not vanity. SnapStart (where applicable) and thinner packages are complementary tactics. Do not confuse reserved concurrency (caps/guarantees concurrency) with provisioned concurrency (pre-initialized environments).
Operational check: measure init versus invoke duration; trim dependencies; evaluate runtime alternatives; enable provisioned concurrency only if the monthly-report SLA requires warm starts; and review cost after one billing cycle.