I'm having an issue where I have 8x slower access to a set of files as compared to the same files in another directory on a linux machine.
The filesystem is a 36TB RAID-5 filesystem exported from a Dell PERC H810, and it's formatted with ext4. The machine has 256GB RAM, and I'm using OpenSuSE 12.3 with kernel 3.7.10-1.45-desktop.
The problem is seen with something simple like "time cat slowdir/* > /dev/null", but "time cat fastdir/* > /dev/null" is about 8x faster. I'm clearing the IO cache between tests (echo 3 > /proc/sys/vm/drop_caches), so that shouldn't be affecting my results.
Both slowdir and fastdir are in the same filesystem and same parent directory.
Here are some more oddities about the problem. If I do the following, the problem persists in the new directory, alsoslowdir:
- cd /parentdir
- cp -r slowdir alsoslowdir
- echo 3 > /proc/sys/vm/drop_caches
- time cat alsoslowdir/* > /dev/null (BAD: takes 8 mins)
But, if I make a new directory, alsofastdir, and copy all of the files into it, then it's 8x faster with this method:
- cd /parentdir
- mkdir alsofastdir
- cp slowdir/* alsofastdir/
- echo 3 > /proc/sys/vm/drop_caches
- time cat alsofastdir/* > /dev/null (GOOD: takes 1 min)
All of the files are between 7 and 15MB in each of the directories and there are a few thousand files, with a total of 58GB in the dir.
I've checked the /usr/sbin/filefrag statistics for all of the files in the fast and slow directories and they are all either 1 or 2 extents, with about the same count of 1 & 2 extents between them.
What am I missing?