Compare commits
2 Commits
fd3b5033a4
...
94126943d5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94126943d5 | ||
|
|
27d75153b9 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "real-debrid-downloader",
|
"name": "real-debrid-downloader",
|
||||||
"version": "1.7.37",
|
"version": "1.7.38",
|
||||||
"description": "Desktop downloader",
|
"description": "Desktop downloader",
|
||||||
"main": "build/main/main/main.js",
|
"main": "build/main/main/main.js",
|
||||||
"author": "Sucukdeluxe",
|
"author": "Sucukdeluxe",
|
||||||
|
|||||||
@ -733,14 +733,14 @@ function extractCpuBudgetPercent(priority?: string): number {
|
|||||||
|
|
||||||
function extractorThreadSwitch(hybridMode = false, priority?: string): string {
|
function extractorThreadSwitch(hybridMode = false, priority?: string): string {
|
||||||
if (hybridMode) {
|
if (hybridMode) {
|
||||||
// Use half the CPU budget during hybrid extraction to leave headroom for
|
// Use 75% of CPU cores during hybrid extraction — downloads are mostly
|
||||||
// concurrent downloads. Falls back to at least 2 threads.
|
// I/O-bound so they don't need much CPU headroom.
|
||||||
const envValue = Number(process.env.RD_EXTRACT_THREADS ?? NaN);
|
const envValue = Number(process.env.RD_EXTRACT_THREADS ?? NaN);
|
||||||
if (Number.isFinite(envValue) && envValue >= 1 && envValue <= 32) {
|
if (Number.isFinite(envValue) && envValue >= 1 && envValue <= 32) {
|
||||||
return `-mt${Math.floor(envValue)}`;
|
return `-mt${Math.floor(envValue)}`;
|
||||||
}
|
}
|
||||||
const cpuCount = Math.max(1, os.cpus().length || 1);
|
const cpuCount = Math.max(1, os.cpus().length || 1);
|
||||||
const hybridThreads = Math.max(2, Math.min(8, Math.floor(cpuCount / 2)));
|
const hybridThreads = Math.max(2, Math.min(12, Math.ceil(cpuCount * 0.75)));
|
||||||
return `-mt${hybridThreads}`;
|
return `-mt${hybridThreads}`;
|
||||||
}
|
}
|
||||||
const envValue = Number(process.env.RD_EXTRACT_THREADS ?? NaN);
|
const envValue = Number(process.env.RD_EXTRACT_THREADS ?? NaN);
|
||||||
@ -1261,9 +1261,10 @@ function startDaemon(layout: JvmExtractorLayout): boolean {
|
|||||||
const args = [
|
const args = [
|
||||||
"-Dfile.encoding=UTF-8",
|
"-Dfile.encoding=UTF-8",
|
||||||
`-Djava.io.tmpdir=${jvmTmpDir}`,
|
`-Djava.io.tmpdir=${jvmTmpDir}`,
|
||||||
"-Xms512m",
|
"-Xms1g",
|
||||||
"-Xmx8g",
|
"-Xmx32g",
|
||||||
"-XX:+UseSerialGC",
|
"-XX:+UseG1GC",
|
||||||
|
"-XX:MaxGCPauseMillis=50",
|
||||||
"-cp",
|
"-cp",
|
||||||
layout.classPath,
|
layout.classPath,
|
||||||
JVM_EXTRACTOR_MAIN_CLASS,
|
JVM_EXTRACTOR_MAIN_CLASS,
|
||||||
@ -1474,6 +1475,10 @@ async function runJvmExtractCommand(
|
|||||||
|
|
||||||
// Try persistent daemon first — saves ~5s JVM boot per archive
|
// Try persistent daemon first — saves ~5s JVM boot per archive
|
||||||
if (isDaemonAvailable(layout)) {
|
if (isDaemonAvailable(layout)) {
|
||||||
|
// Refresh daemon process priority before each request so hybrid
|
||||||
|
// extraction ("high") gets NORMAL priority even if the daemon was
|
||||||
|
// originally started with BELOW_NORMAL.
|
||||||
|
lowerExtractProcessPriority(daemonProcess?.pid, currentExtractCpuPriority);
|
||||||
logger.info(`JVM Daemon: Sofort verfügbar, sende Request für ${path.basename(archivePath)} (pwCandidates=${passwordCandidates.length})`);
|
logger.info(`JVM Daemon: Sofort verfügbar, sende Request für ${path.basename(archivePath)} (pwCandidates=${passwordCandidates.length})`);
|
||||||
return sendDaemonRequest(archivePath, targetDir, conflictMode, passwordCandidates, onArchiveProgress, signal, timeoutMs);
|
return sendDaemonRequest(archivePath, targetDir, conflictMode, passwordCandidates, onArchiveProgress, signal, timeoutMs);
|
||||||
}
|
}
|
||||||
@ -1486,6 +1491,7 @@ async function runJvmExtractCommand(
|
|||||||
const ready = await waitForDaemonReady(15_000, signal);
|
const ready = await waitForDaemonReady(15_000, signal);
|
||||||
const waitedMs = Date.now() - waitStartedAt;
|
const waitedMs = Date.now() - waitStartedAt;
|
||||||
if (ready) {
|
if (ready) {
|
||||||
|
lowerExtractProcessPriority(daemonProcess?.pid, currentExtractCpuPriority);
|
||||||
logger.info(`JVM Daemon: Bereit nach ${waitedMs}ms — sende Request für ${path.basename(archivePath)}`);
|
logger.info(`JVM Daemon: Bereit nach ${waitedMs}ms — sende Request für ${path.basename(archivePath)}`);
|
||||||
return sendDaemonRequest(archivePath, targetDir, conflictMode, passwordCandidates, onArchiveProgress, signal, timeoutMs);
|
return sendDaemonRequest(archivePath, targetDir, conflictMode, passwordCandidates, onArchiveProgress, signal, timeoutMs);
|
||||||
}
|
}
|
||||||
@ -1503,9 +1509,10 @@ async function runJvmExtractCommand(
|
|||||||
const args = [
|
const args = [
|
||||||
"-Dfile.encoding=UTF-8",
|
"-Dfile.encoding=UTF-8",
|
||||||
`-Djava.io.tmpdir=${jvmTmpDir}`,
|
`-Djava.io.tmpdir=${jvmTmpDir}`,
|
||||||
"-Xms512m",
|
"-Xms1g",
|
||||||
"-Xmx8g",
|
"-Xmx32g",
|
||||||
"-XX:+UseSerialGC",
|
"-XX:+UseG1GC",
|
||||||
|
"-XX:MaxGCPauseMillis=50",
|
||||||
"-cp",
|
"-cp",
|
||||||
layout.classPath,
|
layout.classPath,
|
||||||
JVM_EXTRACTOR_MAIN_CLASS,
|
JVM_EXTRACTOR_MAIN_CLASS,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user