Serverless SDK breaks Lambda - glib: Error creating thread: Resource temporarily unavailable

I have a nodejs 10.x based Lambda function that is using Sharp library to convert images to webp. This is based on Amazon’s Serverless Image Handler but built with Serverless and only doing webp conversion. Something like:

const response = await fetch(url);
const buff = return await response.buffer();
image = sharp(buff).withMetadata();
image = image.toFormat('webp', {quality});
res = await image.toBuffer();

This code works most of the time, eg. 50000 invocations/h are successful and 300 invocations/h are failing with the “glib: Error creating thread: Resource temporarily unavailable error”. The error is possibly raised by libvips used by Sharp library and it says that it is not possible to created thread to process my image.

I’ve tried a ton of things (limited Sharp concurrency to 1, increased Lambda limits by AWS support, increased Lambda memory) and nothing helped until finally I’ve changed lambda handler to point directly to my lambda function (not to the handler function created by Serverless - one that wraps my original handler). Without Serverless SDK wrapper everything started to work flawlessly…

Seems that somehow Serverless SDK drain the number of threads on the Lambda containers. Any clues? Is there any specific place where I can submit such kind of errors?