how can i limit system resources for a particular process?
kassube at gmx.net
Thu Jul 2 15:31:41 UTC 2009
Jordi Moles Blanco wrote:
> let's say i want to create an .img file of 50GB with "dd" command.
> After that, i will give it a format with mkfs.ext3.
> The problem is that while "dd" is running I'm not able to do anything
> else on the machine, not even ssh in, it just consumes all the
> available resources, and as I'm creating a 50GB image, i can't access
> the machine for several minutes.
> I've tried to use "nice" command, giving the "dd" process the lowest
> possible priority, 19. The thing is that the whole thing performs
> better, i can establish ssh connection. However, i can't do much when
> I'm in it, everything is so slow.
Try the ionice command. In your case the problem is the constant write
access to the disk. If you want to limit disk access to times where no
other process wants to use the disk, it would be a command like this:
ionice -c3 dd if=/dev/zero of=filename.img bs=10M count=5000
You can even combine it with nice like
nice -19 ionice -c3 dd if=/dev/zero of=filename.img bs=10M count=5000
but I don't think that is necessary.
More information about the kubuntu-users