Search code examples
asp.net-web-apiaws-lambda

API hosted on aws lambda throws System.IO.IOException: No space left on device : '/tmp/ASPNETCORE_00f99566-f7da-45c6-a51d-6a9218291d21.tmp'


we have an asp.net core 6 web api running on aws lambda and it was running fine until yesterday it started throwing the error: System.IO.IOException: No space left on device : '/tmp/ASPNETCORE_00f99566-f7da-45c6-a51d-6a9218291d21.tmp'

the lambda memory is 3GB and the ephemeral storage 512MB, in the largest requests the memory used is usually between 400-600MB and we don't use the ephemeral storage for anything.


Solution

  • It looks like ASP.NET Core automatically stores data in the /tmp directory.

    By default, a Lambda function only provides 512 MB of ephemeral disk space. However, you can increase it in the Lambda function configuration to up to 10 GB.

    https://aws.amazon.com/blogs/aws/aws-lambda-now-supports-up-to-10-gb-ephemeral-storage/