?
Solved

speedy du?

Posted on 2004-11-19
6
Medium Priority
?
534 Views
Last Modified: 2010-08-05
I'm using the command:

du --max-depth=1 -h /home

To get a "quick" (yeah right) overview of my user's disk usage.  The problem is, that it takes between 20 and 35 minutes to finish displaying the results.  And that's with under 20 users!  I plan on having a couple hundred!

The machine is only a few months old, but it is kind of low-end (2.4Ghz Celeron, IDE drives) - however, I can't imagine that really being the problem.

Windows can report back file size on folders dozens deep containing tens of thousands of files in a couple of minutes... is there a way to achieve this with Linux (indexing?).

Thanks.
0
Comment
Question by:s_mack
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 12628205
The time required for du to work on a given disk is essentially a funcion of the number of files/dirs it has to check. For each file du executes a stat() to determine the size.

Unless you've got a lot of data already in /home it seems to me that 20-35 minutes is way too long.  The laptop I'm using right now has about 43k files using about 25Gb of disk. Executing 'du --max-depth=1 -h /home' takes about 15 seconds. So I wonder if you've got some sort of a problem with disk I/O or memory starvation?
0
 

Author Comment

by:s_mack
ID: 12629082
well, the home directory is 170GB with ~1.2 million files.  I didn't realize there were that many files, so maybe it just takes that long.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12629522
That would take a while.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:s_mack
ID: 12629578
Is there anything other than DU that could perhaps give a summary quicker?

I mean - df does its job in seconds, regardless of how much data is used.  I suppose I could mount each user seperately and just use df... but is there perhaps a df-like utility that could work for me?  I don't need the detail that du does.. .just a summary.
0
 
LVL 40

Accepted Solution

by:
jlevie earned 200 total points
ID: 12629993
Do you need it frequently, of would daily suffice? If a daily report is acceptable you could generate the  stats from a cron job run sometime at night with the results dropped in a file.

I don't know of anything that's going to be faster than du.
0
 

Author Comment

by:s_mack
ID: 12630011
Thanks.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question