TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

2 pointsby zatkinover 9 years ago
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

mschuster91over 9 years ago
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.