[Ocfs2-users] Max number of files?

Joel Becker Joel.Becker at oracle.com
Tue May 12 10:36:52 PDT 2009


On Tue, May 12, 2009 at 10:49:08PM +1000, Andrew (Anything) wrote:
> It's ocfs2 created on kernel about 2.6.18 or so, now running on 2.6.29.1.
> But ive recently discovered has almost no features enabled. Intend on
> remaking it soon.
> Could possibly have been quite fragmented, but it has almost 50% free space,
> sorry I should have included that.

	What version you created it on isn't as important as what
version you're running with.  If you ran a while with the 2.6.18-or-so,
it might have set up some bad layouts.

> Does ocfs2 fragment badly with many changes?

	Not more than other things, really.  But ocfs2's dynamic inode
allocator adds inodes in 1MB chunks.  So when it's out of inodes, it
needs to grab 1MB of contiguous disk space to add more.
	Your filesystem might not be very fragmented overall, but if the
area that's free is fragmented, it won't be able to find space for that
contiguous 1MB.

> I wrote something to find me any big dirs and left it running this
> afternoon. Found one with 20000 files but that's about it.
> Also discovered that an ftp client regularly opening up a dir of 5000 or so
> files, and then adding one, was really putting a slowdown on things. Removed
> those files and interacting with the fs directly seem a little more zippy
> now.

	ocfs2 didn't handle large directories very well until, well,
until 2.6.31.  Prior to that, directory access was linear.  If the file
you wanted in the directory was the 4999th file, you had to read the
entire directory to get it.  So your ftp client had to walk many
directory blocks to find space to create its file.
	 In 2.6.31-rc we've added directory indexing.  This makes
lookup, link, and unlink of files very fast.  With that new feature,
we've removed the 32000 file limit.  But you'll need 2.6.31 and the new
feature, and we don't have fsck support yet :-P.

Joel

-- 

"Against stupidity the Gods themselves contend in vain."
	- Friedrich von Schiller

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-users mailing list