Message from discussion
Maximum amount of files per directory
Path: g2news1.google.com!news2.google.com!news.glorb.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!ltu.se!luth.se!193.180.251.40.MISMATCH!erinews.ericsson.se!news.al.sw.ericsson.se!not-for-mail
From: birre <spamt...@norsborg.net>
Newsgroups: alt.os.linux.suse
Subject: Re: Maximum amount of files per directory
Date: Tue, 06 Nov 2007 13:40:37 +0100
Organization: none
Lines: 43
Message-ID: <fgpnc6$q51$1@news.al.sw.ericsson.se>
References: <5pal1mFq83asU1@mid.individual.net> <4730242a$1@news.uni-ulm.de> <5pao0rFq0jk0U1@mid.individual.net> <47302c50$1@news.uni-ulm.de> <5paq42Fqi6ljU2@mid.individual.net>
NNTP-Posting-Host: ws46163.uab.ericsson.se
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.al.sw.ericsson.se 1194352838 26785 134.138.46.163 (6 Nov 2007 12:40:38 GMT)
X-Complaints-To: abuse@ericsson.se
NNTP-Posting-Date: Tue, 6 Nov 2007 12:40:38 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.6 (X11/20070802)
In-Reply-To: <5paq42Fqi6ljU2@mid.individual.net>
On 2007-11-06 10:22, Merlin Morgenstern wrote:
> Andreas schrieb:
>> Hi,
>>
>> Merlin Morgenstern wrote:
>>> thank you for your reply. How can I find out which file system I am
>>> running on the machine?
>>
>> The mount command or the /etc/fstab file.
>>
>>>> Lookups should be in some O(log n).
>>> I am sorry, what does that mean? Can you be more specific?
>>
>> It means that the time would increase, but not linear. Having ten times
>> as many files won't take ten times longer.
>>
>> kindr regards,
>> Andreas
>
> HI Anreas,
>
> the filesystem is:
> /dev/sda7 on /home type ext2 (rw,acl,user_xattr)
>
> Do you believe I will notice a performance problem lets say with 500.000
> files in one directory?
>
> Best regards,
>
> Merlin
If you once have 500000 files in a directory, it will be terrible slow to
do ls , even after you delete 499999 of them, since the directory itself
will be huge, and never shrink when removing files.
The only way to clean it is to make a new directory.
If your application know the name and call the file, it will not be so slow,
it's just the other way, when listing the contents of a directory.
Reiserfs is better to handle this, and if you turn off acl and xattr you make
it a bit faster. (unless you need those features)
/bb