Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/sim/lib/core/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export const env = createEnv({
IVM_DISTRIBUTED_MAX_INFLIGHT_PER_OWNER:z.string().optional().default('2200'), // Max owner in-flight leases across replicas
IVM_DISTRIBUTED_LEASE_MIN_TTL_MS: z.string().optional().default('120000'), // Min TTL for distributed in-flight leases (ms)
IVM_QUEUE_TIMEOUT_MS: z.string().optional().default('300000'), // Max queue wait before rejection (ms)
IVM_MAX_EXECUTIONS_PER_WORKER: z.string().optional().default('500'), // Max lifetime executions before worker is recycled
IVM_MAX_EXECUTIONS_PER_WORKER: z.string().optional().default('200'), // Max lifetime executions before worker is recycled
Comment thread
waleedlatif1 marked this conversation as resolved.
IVM_MAX_BROKER_ARGS_JSON_CHARS: z.string().optional().default('262144'), // Max JSON payload size for sandbox task broker args (isolate→host)
IVM_MAX_BROKER_RESULT_JSON_CHARS: z.string().optional().default('16777216'),// Max JSON payload size for sandbox task broker results (host→isolate)
IVM_MAX_BROKERS_PER_EXECUTION: z.string().optional().default('1000'), // Max broker calls per sandbox task execution
Expand Down
8 changes: 4 additions & 4 deletions apps/sim/lib/execution/isolated-vm-worker.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ async function executeCode(request, executionId) {
const externalCopies = []

try {
isolate = new ivm.Isolate({ memoryLimit: 256 })
isolate = new ivm.Isolate({ memoryLimit: 128 })
if (executionId !== undefined) activeIsolates.set(executionId, isolate)
context = await isolate.createContext()
const jail = context.global
Expand Down Expand Up @@ -388,7 +388,7 @@ async function executeCode(request, executionId) {
stdout,
error: {
message:
'Execution exceeded memory limit (256 MB). Reduce image sizes or split the work into smaller batches.',
'Execution exceeded memory limit (128 MB). Reduce image sizes or split the work into smaller batches.',
name: 'MemoryLimitError',
},
}
Expand Down Expand Up @@ -529,7 +529,7 @@ async function executeTask(request, executionId) {
let tPhase = tStart

try {
isolate = new ivm.Isolate({ memoryLimit: 256 })
isolate = new ivm.Isolate({ memoryLimit: 128 })
Comment thread
waleedlatif1 marked this conversation as resolved.
if (executionId !== undefined) activeIsolates.set(executionId, isolate)
context = await isolate.createContext()
const jail = context.global
Expand Down Expand Up @@ -945,7 +945,7 @@ async function executeTask(request, executionId) {
stdout,
error: {
message:
'Execution exceeded memory limit (256 MB). Reduce image sizes or split the work into smaller batches.',
'Execution exceeded memory limit (128 MB). Reduce image sizes or split the work into smaller batches.',
name: 'MemoryLimitError',
},
timings,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/lib/execution/isolated-vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const DISTRIBUTED_MAX_INFLIGHT_PER_OWNER =
Number.parseInt(env.IVM_DISTRIBUTED_MAX_INFLIGHT_PER_OWNER) ||
MAX_ACTIVE_PER_OWNER + MAX_QUEUED_PER_OWNER
const DISTRIBUTED_LEASE_MIN_TTL_MS = Number.parseInt(env.IVM_DISTRIBUTED_LEASE_MIN_TTL_MS) || 120000
const MAX_EXECUTIONS_PER_WORKER = Number.parseInt(env.IVM_MAX_EXECUTIONS_PER_WORKER) || 500
const MAX_EXECUTIONS_PER_WORKER = Number.parseInt(env.IVM_MAX_EXECUTIONS_PER_WORKER) || 200
Comment thread
waleedlatif1 marked this conversation as resolved.
const MAX_BROKER_ARGS_JSON_CHARS = Number.parseInt(env.IVM_MAX_BROKER_ARGS_JSON_CHARS) || 262_144
const MAX_BROKER_RESULT_JSON_CHARS =
Number.parseInt(env.IVM_MAX_BROKER_RESULT_JSON_CHARS) || 16_777_216
Expand Down
Loading