2002-02-01 18:29:58

by Nathan Neulinger

[permalink] [raw]
Subject: Artificially starving a process for CPU/Disk/etc?

I've got a situation where I want to simulate a server process getting starved for cpu/paging to death/etc. I realize I could renice the process(s) and then create artificial loading on the machine, but is there any way to do this more effectively?

I.e. is there some hack I could use to tell a particular set of processes that they get like 0.05% of the cpu time, even during idle?

The idea is to simulate a server that has gone south, but still be able to do monitoring/debug/analysis on that server to see what happens. During this happening in a real situation, you'd be unable to monitor on the box, cause it would be close to dead.

-- Nathan

------------------------------------------------------------
Nathan Neulinger EMail: [email protected]
University of Missouri - Rolla Phone: (573) 341-4841
Computing Services Fax: (573) 341-4216


2002-02-01 23:39:23

by Alan

[permalink] [raw]
Subject: Re: Artificially starving a process for CPU/Disk/etc?

> I've got a situation where I want to simulate a server process getting
> starved for cpu/paging to death/etc. I realize I could renice the process(s)
> and then create artificial loading on the machine, but is there any way to
> do this more effectively?

There are a couple of approaches. One is to use ptrace the other
just signals and keep stopping/starting the process. Neither will give
accurate paging to death behaviour. To get that you would have to do some
simulated fault and pauses every new page access.

Alan