On 9/26/13 8:30 AM, Ronnie Tartar wrote:
> Stan, looks like I have directory fragmentation problem.
> xfs_db> frag -d
> actual 65057, ideal 4680, fragmentation factor 92.81%
> What is the best way to fix this?
We should just get rid of that command, TBH.
So your dirs are in an average of 65057/4680 or about 14 fragments each.
Really not that bad, in the scope of things.
I'd imagine that this could be more of your problem:
> folders are image folders that have anywhere between 5 to 10 million images
> in each folder.
at 10 million entries in a dir, you're going to start slowing down on inserts
due to btree management. But that probably doesn't account for multiple
a single file.
So really,it's not clear *what* is slow.
> It takes about 2.5 to 3.5 seconds to write a single file.
strace with timing would be a very basic way to get a sense of what is slow;
is it the file open/create? How big is the file, are you doing buffered or
On a more modern OS you could do some of the tracing suggested in
but some sort of profiling (oprofile, perhaps) might tell you where time is
being spent in the kernel.
When you say suddenly started, was it after a kernel upgrade or other change?