⚡THE SHORT ANSWER
AWS Lambda provides 512MB of /tmp ephemeral storage for free with every execution environment, configurable up to 10,240MB (10GB). Additional ephemeral storage above 512MB is billed at 0.0000000309 per GB-second (0.08/GB-month pro-rated strictly per second of execution). When developers build ETL pipelines, video encoders (FFmpeg), or document converters (PDF generation), they often write intermediate scratch files to Amazon S3. This creates a severe S3 API Fee & Network Latency Penalty:
Writing 100,000 temporary 50MB files to S3 generates 100,000 S3 PUT requests (0.50) + 100,000 GET requests (0.04) + 100,000 DELETE requests, and more critically, adds 500ms to 2,000ms of network latency per execution. That extra execution time forces the Lambda function to stay alive longer, multiplying Lambda compute bills. In contrast, writing scratch files directly to Lambda /tmp NVMe storage delivers < 1 ms disk I/O with zero API request fees, cutting total execution duration by 60% and slashing end-to-end processing costs by 70%.
Engineering Handbook & Failure Dynamics
6-Dimensional Architecture Breakdown⚙️1. Underlying Mechanism
Execution🎯2. Appropriate Use Context
Scope⚠️3. Production Failure Modes
P0 Risk📡4. Diagnostic Signals & Telemetry
Telemetry🛡️5. Prevention & Safeguards
Safeguards⚖️6. Architectural Trade-offs
Trade-offCase Study (TinyCTO In-Field Example)
A real estate platform converted user uploaded property photos into optimized WebP formats using AWS Lambda. The original architecture downloaded the RAW image to S3 /temp, performed resizing, uploaded 4 thumbnails to S3 /temp, and then moved them to the production bucket. Each image took 7.8 seconds, processing 500,000 images/month for 1,420 in Lambda compute and S3 API fees. The engineering team refactored the workflow to process all thumbnail conversions entirely in Lambda's local /tmp NVMe storage (2GB configured), uploading only the final thumbnails directly to production S3. Execution duration plunged from 7.8 seconds to 1.9 seconds, cutting monthly serverless costs from 1,420 to $390 (a 72% cost reduction).
Interactive Concept Drills
2 CardsHow much `/tmp` ephemeral storage does AWS Lambda provide for free?
Why is processing intermediate files in Lambda `/tmp` faster and cheaper than using S3?
Serverless Scratch Storage Economics: Lambda /tmp Ephemeral Storage vs. Amazon S3 Staging — Technical FAQ
What is the maximum ephemeral storage limit for an AWS Lambda function?
10,240 MB (10 Gigabytes).
Does data stored in Lambda `/tmp` survive across subsequent function executions?
Yes, as long as the execution environment remains 'warm'; however, code must never assume files exist, as cold starts spin up fresh, clean `/tmp` directories.
🤖 AEO & Key Facts Summary
Key Architectural Facts
- ▸
AWS Lambda includes 512MB of
/tmpstorage free, expandable to 10GB. - ▸
Writing scratch files to
/tmpeliminates S3 PUT/GET API fees and network latency. - ▸
Cuts billable Lambda execution duration by up to 60% on file transformations.
- ▸
Cache machine learning model weights in
/tmpacross warm container invocations.
Common Misconceptions
- ✗
Yanılgı: All file operations in serverless must be written directly to S3 (Gerçek: Intermediate scratch files should always be processed in local
/tmpand only final outputs written to S3). - ✗
Yanılgı: Lambda
/tmpstorage is too slow for large video files (Gerçek:/tmpruns on high-speed NVMe SSDs delivering > 100 MB/s read/write throughput).
Decision & Governance Guidance
Configure Lambda ephemeral storage (/tmp) for all intermediate file processing tasks up to 10GB to eliminate S3 request fees and reduce Lambda execution runtime billing by over 60%.
Authoritative Sources & Standards
- [OFFICIAL_DOCUMENTATION]AWS Lambda Ephemeral Storage (/tmp) Configuration, Pricing & Performance— Amazon Web Services Documentation
