TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Limiting CPU, memory, and I/O usage on a program for testing

2 点作者 zatkin超过 9 年前
It’s great that we’re now in an era of computing where we have an immense and vast amount of computational power at the edge of our fingertips, but it’s also a burden because it leaves us vulnerable to writing software that consumes far more CPU, memory, and I&#x2F;O than necessary.<p>Does anyone know of software that allows you to test with certain (CPU, RAM, I&#x2F;O) thresholds in place? And also, what about monitoring tools to see how much CPU, memory, and I&#x2F;O a program consumes when run?

1 comment

mschuster91超过 9 年前
Well you can always launch your software inside a limited VM, I&#x27;m thinking of cgroups for limiting CPU if a VM is unfeasible.<p>Limiting network bandwidth (or introducing random packet drops etc.) can be done with pf.<p>Monitoring CPU&#x2F;MEM load is best done with htop (if you&#x27;re interested in long term metrics, look for Nagios).<p>Short term IO (HDD!) load is best done via iotop. Oh, and iftop is your friend for on-demand monitoring of network.