Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

du performance

Status
Not open for further replies.

Mag0007

MIS
Feb 15, 2005
829
US
if i have a very large filesystem (/usr) is there a way to improve the performance of du /usr?

it takes about 5 mins to get my results back...

 
I don't think you can make it much faster. Alternatively you could use find /usr -ls and add up the file sizes using awk or something, but I'm not sure whether that will achieve what you require.

Annihilannic.
 
thanks for the reply. Yes, you are correct I don't think it will really acheive what I require, because I will be doing a lot of pipes with du (pipes to sort and awk)

 
stefanwagner:

VERY VERY true! on AIX it works like that.

Thanks for the reply!
 
You can improve the perf. of your script even more by first storing the output of du in a temp file and instead of doing du over and over just cat-ing the temp file on the sort and awk pipes.

It's a tradeoff between accuracy and strain on IO-system, because you'll be basing your sort and awk pipes on the du output of a while ago, but catting a file is easier than stat-ing each file/dir in a filesystem and counting blocks - even if the data is 95% cached...


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top