A new directory index framework that takes the advantages of both hash functions and B
+
-tree is proposed for storage system of Web server to solve the problem that existing directory indexing structures in file systems result in significant delays when they are used to process a large number of files or directories
especially when there are over hundreds of thousands of files in a single directory. The framework adopts hash functions to normalize file names with variable length to integers
thus file names can be found through a hash table in O(1)complexity. On the other hand
inode numbers of files in a directory are indexed by a B
+
-tree with high fanout to support fast insertion or removing operations. Benchmark of a simple implementation reveals that the proposed framework can easily hand up to half a million files in a single direct
ory
and can significantly improve performance
that is
its speed in searching entries is faster by at least 40% than Ext3
and in creating or deleting files is faster by at least 73% than Ext3 or Reiserfs.
关键词
Keywords
references
AGRAWAL N, BOLOSKY W J, DOUCEUR J R, et al. A five-year study of file-system metadata [J]. ACM Transactions on Storage, 2007, 3(3): 1-32.
ZADOK E, BADULESCU I. Usenetfs: a stackable file system for large article directories [EB/OL].(2000-07-10)[2012-03-01]. http:∥www.cs.columbia.edu/~library/TR-repository/reports/reports-1998/ cucs-022-98.pdf.
PEARSON O. Squid: a user's guide [EB/OL]. [2012-03-05]. http:∥oss.org.cn/man/newsoft/squid/book-full-html/book-full.html.
Webmaster World. How to speed up directory reading? [EB/OL].(2008-03-05)[2012-03-06]. http:∥www.webmasterworld.com/apache/3592129.htm.
RÉMY C, THEODORE T, STEPHEN T. Design and implementation of the second extended file system [C]∥Proceedings of the First Dutch International Symposium on Linux. Amsterdam, Netherlands: State University of Groningen, 1994: 1-6.
PHILLIPS D. A directory index for Ext2 [C]∥Proceedings of the 5th annual Linux Showcase Conference. Oakland, California, USA: USENIX Association, 2001: 173-182.
BUCHHOLZ F. The structure of the Reiser file system [EB/OL].(2006-01-26)[2012-03-01]. http:∥homes.cerias.purdue.edu/florian/reiser/reiserfs.php.
BAEZA-YATES R A. Expected behaviour of B+-trees under random insertions [J]. Acta Informatica, 1989, 26(5): 439-471.
CHRISTIAN H, CARSTEN S, TANJA Z. Empirical evaluation of hash functions for multipoint measurements [J]. SIGCOMM Computer Communication Review, 2008, 38(3): 39-50.
COKER R. Bonnie++1.03e [EB/OL].(2008-12-10)[2012-03-04]. http:∥www.coker.com.au/bonnie++/.
MORREALE P W, VAN RIEL R. Linux documentation for/proc/sys/vm/* [EB/OL]. [2012-03-08]. http:∥www.kernel.org/doc/Documentation/sysctl/vm.txt.