Timur Fanshteyn
Timur Fanshteyn

Reputation: 2296

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 the box utility, instead of writing one myself.

Upvotes: 3

Views: 344

Answers (2)

caf
caf

Reputation: 239011

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.

Upvotes: 2

John Millikin
John Millikin

Reputation: 200766

man ulimit

You can use it to limit how much memory and CPU time a process can use.

Upvotes: 2

Related Questions