Simulate lack of system resources on Linux machine
Can someone recommend a utility to simulate a resource constraint on a Linux system. I need to test performance of the system under stress - both memory and CPU.
I would need something that would allocate an amount of memory, therefore leaving less for the program I am testing.
And also would use up all available CPU.
I am preferring an out of 开发者_JS百科the box utility, instead of writing one myself.
The stress program sounds like what you want - it is described thus:
stress is a simple workload generator for POSIX systems. It imposes a configurable amount of CPU, memory, I/O, and disk stress on the system.
man ulimit
You can use it to limit how much memory and CPU time a process can use.
精彩评论