mirror of
https://github.com/lovell/sharp.git
synced 2025-12-18 23:05:04 +01:00
Reduce default concurrency for musl thread over-subscription
https://github.com/lovell/sharp-libvips/issues/229
This commit is contained in:
@@ -153,6 +153,9 @@ function concurrency (concurrency) {
|
||||
if (detectLibc.familySync() === detectLibc.GLIBC && !sharp._isUsingJemalloc()) {
|
||||
// Reduce default concurrency to 1 when using glibc memory allocator
|
||||
sharp.concurrency(1);
|
||||
} else if (detectLibc.familySync() === detectLibc.MUSL && sharp.concurrency() === 1024) {
|
||||
// Reduce default concurrency when musl thread over-subscription detected
|
||||
sharp.concurrency(require('node:os').availableParallelism());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user