piscina icon indicating copy to clipboard operation
piscina copied to clipboard

resourceLimits Working

Open SiDDhartharG opened this issue 1 year ago • 1 comments

I am operating a server that runs 20 threads, primarily tasked with executing JavaScript code provided by users.

Occasionally, this user-provided code either contains memory leaks or is highly memory-intensive. In situations where the memory consumption of a task or thread exceeds a certain threshold (such as 200MB), I need a way to terminate that specific task or thread.

Can Piscina offer any functionality to assist with this requirement? I would appreciate some guidance on this matter.

SiDDhartharG avatar Jan 24 '24 12:01 SiDDhartharG

👋 You can use resourceLimits options when instantiating Piscina, those will be automatically forwarded to any Worker_Thread instance at the moment of spinning up a new thread:

Reference

metcoder95 avatar Jan 24 '24 21:01 metcoder95

This issue has been marked as stale because it has been opened 30 days without activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar May 05 '24 10:05 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar May 19 '24 10:05 github-actions[bot]