0

I have a complex directory structure with lot of small files in it. like:

/opt/data/1000/45/32/2009/10/15/76543.zip

When I launch a du or find on this directory (/opt/data/) my server load increases a lot (0,5 --> 25) and my system doesn't respond any more.

Can I "slow down" the execution of the du/find command to keep my system accessible? I don't care if the command takes 3 days to run :-) I've tried with nice -n 19 with no success...

Thank you !

Froggiz
  • 3,043
  • 1
  • 19
  • 30
Matthieu
  • 443
  • 4
  • 12
  • I'm not 100% sure, but the problem is that DU is disk I/O intensive, and I think NICE will only prioritize CPU resources. I don't really have an answer, but I though that this comment could help. – Bob Rivers Dec 03 '09 at 15:15
  • yes bob, you're right. the problem is I/O... – Matthieu Dec 03 '09 at 15:29

2 Answers2

8

You could use "ionice" to be more gentle to the system.

Ex:

$ ionice du /opt/data

You can even set the io scheduling on a pid:

$ ionice -c 3 -p 1023

See man page for more info on how to use "ionice"

rkthkr
  • 8,618
  • 28
  • 38
1

I would do both ionice and nice:

So after running ionice, then run renice:

renice -n 20 -p 1023

You could also just launch the process with nice in the first place.

Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448