I have a slow disk with 3mill images in ~300K directories, linux mint on ubuntu 18.04.

df -lk:
/dev/sdb1      1952558140 1214544040    738014100   63% /data

cat /etc/fstab:
UUID=<uid> /data      xfs     rw,relatime,attr2,inode64,noquota 0 0

If the drive has not been accessed in 30 minutes it takes ~3minutes to get up a directory. Just today I've wasted 20 minutes.

I've added a crontab job so it does not go out of cache:

*/20 * * * * find /data/imglib -maxdepth 2 -type d &> /dev/null

But it is very noisy. The job above takes 6minutes, are there some mount options or kernel parameters to keep this disk longer in the cache?

  • 1
    Consider adding more RAM. One presumes it's being forced out of cache because cache is limited and the OS wants to cache something else. Another option could be to migrate unrelated services off of this machine, so that there are fewer processes competing for cache space.
    – Jim L.
    Jul 4, 2019 at 21:55
  • I' wil ladd another 16GB, thanks
    – MortenB
    Jul 8, 2019 at 11:31


You must log in to answer this question.

Browse other questions tagged .