linux – 将文件存储在目录中……有限制吗?

我正在使用带有Plesk 9(64位)的CentOS 5,我正在运行一个用户上传图片的网站.使用64位操作系统,我可以存储多少个文件有限制吗?我所关心的只是性能,并提供文件.我不希望有四个分散文件的目录.但是,我希望,在某些时候我可以拥有200-300万张图像.

解决方法

如果你是 using ext3,我找到 this quote(警告:西班牙语网站)

“There is a limit of 32k (32768)
subdirectories in a single directory,
a limitation likely of only academic
interest,as many people don’t even
have that many files (though huge mail
servers may need to keep that in
mind). The ext2 inode specification
allows for over 100 trillion files to
reside in a single directory”

Further reading表明ext3没有32K的限制,可以凭经验证明

a=0; i=1; while [ $a == 0 ]; do touch $i; a=$?; let i++; done

但它确实有一个文件夹的32K文件夹限制,可以测试

a=0; i=1; while [ $a == 0 ]; do mkdir $i; a=$?; let i++; done

This (unfounded) claim

ReiserFS has no trouble at all with
hundreds of thousands of files in a
single directory. flabdablet – February 1,2007

来自姐妹网站stackoverflow.com的This question也可以提供帮助.

一般来说:

>目录数量有限制,>你应该保持你的文件/目录在32K以下,但可以进一步,>您使用的文件系统很重要.

相关文章

1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...
1 删除0字节文件 find -type f -size 0 -exec rm -rf {} ...
## 步骤 1:安装必要的软件包 首先,需要确保系统已安装 `dh...