Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为不受信任的代码编写隔离沙箱,因此我正在寻找隔离代码执行的安全方法。我还需要一种方法来收集代码统计信息(内存使用情况、cpu 使用情况等)
我尝试过 Docker,但 Stats API 只能在第二个周期内流式传输,并且一些代码(尤其是用 C 或 C++ 编写的)运行速度快 1000 倍以上。
我问了一个问题,setrlimit但是人们在评论中写道用户可以取消限制(可能有办法阻止用户这样做?)
setrlimit
我也听说过ulimit。这种方式足够安全并且不能被用户覆盖吗?
ulimit