Skip to content

Commit

Permalink
Run du with ionice
Browse files Browse the repository at this point in the history
Let us run du with idle io priority
  • Loading branch information
dims committed May 8, 2018
1 parent 5a2e3d0 commit 47a5869
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ func GetDirDiskUsage(dir string, timeout time.Duration) (uint64, error) {
if dir == "" {
return 0, fmt.Errorf("invalid directory")
}
cmd := exec.Command("nice", "-n", "19", "du", "-s", dir)
cmd := exec.Command("ionice", "-c3", "nice", "-n", "19", "du", "-s", dir)
stdoutp, err := cmd.StdoutPipe()
if err != nil {
return 0, fmt.Errorf("failed to setup stdout for cmd %v - %v", cmd.Args, err)
Expand Down

0 comments on commit 47a5869

Please sign in to comment.