Skip to content

Commit

Permalink
fix: don't halve mem_limit twice
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Nov 10, 2023
1 parent 82fb706 commit 26f6faf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/threading/threadHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const MEM_CONCURRENCY_RATIO = parseFloat(process.env.MEM_CONCURRENCY_RATIO ?? 0.

const CORE_LIMIT = Math.ceil(os.cpus().length * CORE_CONCURRENCY_RATIO);

const MEM_LIMIT = Math.ceil((os.totalmem() / 2e9) * MEM_CONCURRENCY_RATIO);
const MEM_LIMIT = Math.ceil((os.totalmem() / 1e9) * MEM_CONCURRENCY_RATIO);

// Ex. Prod: 16 cores / 64GB mem = min(16 * 2, 32) = 32 allowed concurrently
// Divided by 4 because each instance uses 4 sub-instances for reliability
Expand Down

0 comments on commit 26f6faf

Please sign in to comment.