Sharp: vips__write: write failed...

Created on 18 Apr 2019  路  2Comments  路  Source: lovell/sharp

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.

question

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 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

All 2 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AVVS picture AVVS  路  3Comments

natural-law picture natural-law  路  3Comments

jaydenseric picture jaydenseric  路  3Comments

jaekunchoi picture jaekunchoi  路  3Comments

janaz picture janaz  路  3Comments