Home › AWS Developer Associate › cloudcomputing › awsdevtroubleshooting › A serverless app's Lambda functions are billed p…
A serverless app's Lambda functions are billed per-millisecond. Which cost-optimization step has the BIGGEST impact on functions whose runtime is dominated by waiting for I/O (DB queries, HTTP calls)?
ATriple the function's memory unconditionally
BDisable CloudWatch logs
CSwitch the function language from Python to Java
DOptimise the downstream calls (e.g. add connection reuse via RDS Proxy / HTTP keep-alive) so total runtime shrinks
Answer & Solution
Correct answer: D. Optimise the downstream calls (e.g. add connection reuse via RDS Proxy / HTTP keep-alive) so total runtime shrinks
I/O-bound functions wait on the network; cutting that wait (RDS Proxy reuses DB connections, HTTP keep-alive avoids handshake) directly reduces billed ms. More memory helps CPU-bound work. Language switch is orthogonal. Disabling logs cripples ops.
Related questions
Which CloudWatch construct sends an SNS notification when a Lambda's error rate exceeds 5%An application sends events to an SQS queue. Suddenly the queue's `ApproximateNumberOfMessA Lambda function in a VPC hits an external HTTPS API. Cold starts now take 8+ seconds insA team needs to query Lambda logs ad-hoc with SQL-like syntax (filter by request id, errorWhich CloudWatch feature lets a developer build a dashboard showing graphs of multiple metA Lambda function called from API Gateway returns 502 Bad Gateway under load. Logs show "TA Lambda function's 99th-percentile latency is dominated by cold starts. Which optimisatioA Lambda function intermittently exceeds its memory limit. The team has identified high me