Env: AWS Lamba 8.10
Sharp: 0.22.0
This error occurs when running a few requests is succession for resizing a PNG.
Error: vips__write: write failed\nunix error: No space left on device\nvips2png: unable to write to buffer
If I wait a few seconds for what I assume is AWS purging the lambda out of memory it will start working again for a few more resizes. I have yet to see this issue when resizing jpegs.
Hello, you've not shared any code here but the "No space left on device vips2png: unable to write to buffer" message suggests you are using toBuffer the output the result of resizing a large input.
To avoid libvips writing temporary files try setting the VIPS_DISC_THRESHOLD environment variable to a value greater than the default of 100MB.
https://libvips.github.io/libvips/API/current/VipsImage.html#vips-image-new-from-file
You are correct, I am using toBuffer.
Before you replied I solved it by using .sequentialRead() and got a tiny speed boost for pngs. I鈥檒l give the ENV var a shot tomorrow and see how it differs, thanks!
Most helpful comment
Hello, you've not shared any code here but the "No space left on device vips2png: unable to write to buffer" message suggests you are using
toBufferthe output the result of resizing a large input.To avoid libvips writing temporary files try setting the
VIPS_DISC_THRESHOLDenvironment variable to a value greater than the default of 100MB.https://libvips.github.io/libvips/API/current/VipsImage.html#vips-image-new-from-file