{"record":{"id":"7ca39ca2aed1b54d","repo":"quickwit-oss/quickwit","slug":"lambda-memory-must-be-at-least-1gb","errorCode":null,"errorMessage":"lambda memory must be at least 1GB","messagePattern":"lambda memory must be at least 1GB","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-lambda-server/src/context.rs","lineNumber":56,"sourceCode":"        let storage_resolver = StorageResolver::configured(&Default::default());\n\n        Ok(Self {\n            searcher_context,\n            storage_resolver,\n        })\n    }\n}\n\n/// Create a Lambda-optimized searcher config based on the `AWS_LAMBDA_FUNCTION_MEMORY_SIZE`\n/// environment variable.\nfn try_searcher_config_from_env() -> anyhow::Result<SearcherConfig> {\n    let lambda_memory_mib: u64 = quickwit_common::get_from_env_opt(\n        \"AWS_LAMBDA_FUNCTION_MEMORY_SIZE\",\n        /* sensitive */ false,\n    )\n    .context(\"could not get aws lambda function memory size from ENV\")?;\n    let lambda_memory = ByteSize::mib(lambda_memory_mib);\n    anyhow::ensure!(\n        lambda_memory >= ByteSize::gib(1u64),\n        \"lambda memory must be at least 1GB\"\n    );\n    let warmup_memory_budget = ByteSize::b(lambda_memory.as_u64() - ByteSize::mib(500).as_u64());\n\n    let mut searcher_config = SearcherConfig::default();\n    searcher_config.max_num_concurrent_split_searches = 20;\n    searcher_config.warmup_memory_budget = warmup_memory_budget;\n    searcher_config.fast_field_cache = CacheConfig::no_cache();\n    searcher_config.split_footer_cache = CacheConfig::no_cache();\n    searcher_config.predicate_cache = CacheConfig::no_cache();\n    searcher_config.partial_request_cache = CacheConfig::no_cache();\n    Ok(searcher_config)\n}\n","sourceCodeStart":38,"sourceCodeEnd":71,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-lambda-server/src/context.rs#L38-L71","documentation":"try_searcher_config_from_env reads AWS_LAMBDA_FUNCTION_MEMORY_SIZE from the Lambda runtime environment and requires the function to be configured with at least 1GB of memory. The warmup memory budget is derived by subtracting 500MiB of overhead, so less than 1GB would leave too little room for the searcher to operate. The anyhow::ensure! aborts startup otherwise.","triggerScenarios":"Booting the quickwit-lambda-server binary inside a Lambda configured with AWS_LAMBDA_FUNCTION_MEMORY_SIZE below 1024 MiB (e.g. 512MB or 128MB in the function configuration or IaC template).","commonSituations":"Deploying the searcher Lambda with the AWS console default (128MB) or a cost-optimized small memory setting; SAM/CDK/Terraform templates that never raised memory_size for the function.","solutions":["Raise the Lambda memory setting to at least 1024MB (AWS console: Configuration > General configuration > Memory; CLI: aws lambda update-function-configuration --memory-size 2048).","In your IaC template, set MemorySize >= 1024 for the function resource.","If testing locally, set AWS_LAMBDA_FUNCTION_MEMORY_SIZE=2048 in the environment before running the handler."],"exampleFix":"// before (SAM template)\nMemorySize: 512\n// after\nMemorySize: 4096","handlingStrategy":"validation","validationCode":"let mem: u64 = std::env::var(\"AWS_LAMBDA_FUNCTION_MEMORY_SIZE\")\n    .ok()\n    .and_then(|v| v.parse().ok())\n    .unwrap_or(0);\nassert!(mem >= 1024, \"Lambda memory must be >= 1024MB, got {}\", mem);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set MemorySize >= 1024 (preferably 2048-4096) in your Lambda IaC template.","Add a deployment-time check that reads the function configuration after create/update.","When running locally, export AWS_LAMBDA_FUNCTION_MEMORY_SIZE explicitly."],"tags":["aws","lambda","env-var","configuration"],"backgroundTag":"invalid-env-var-value","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}