acl handling on delete (performance problem)

Jure Peèar pegasus at nerv.eu.org
Sun Jul 25 23:41:43 GMT 2004


On Sun, 25 Jul 2004 18:15:14 +0200
Jure Peèar <pegasus at nerv.eu.org> wrote:

> Samba 3.0.x PDC in a mixed 9x/nt/xp environment, using acls. When trying
> to delete a large number of folders from a folder, the 'preparing to
> delete' stage takes about half hour.
> 
> It's simple to repeat: set up samba pdc, join an xp client into the
> domain, map a share with some 4000 folders and try to delete them.
> 
> Strace of a smbd proccess in the 'preparing to delete' stage looks like
> this:
> 
> stat("/mnt/test/test/0220", {st_mode=S_IFDIR|0755, st_size=6, ...}) = 0
> gettimeofday({1090703949, 903367}, NULL) = 0
> stat("/mnt/test/test/0220", {st_mode=S_IFDIR|0755, st_size=6, ...}) = 0
> getxattr("/mnt/test/test/0220", "system.posix_acl_access", 0x11fffe940,
> 132)= -1 ENODATA (No data available)
> stat("/mnt/test/test/0220", {st_mode=S_IFDIR|0755, st_size=6, ...}) = 0
> getxattr("/mnt/test/test/0220", "system.posix_acl_default", 0x11fffe940,
> 132) = -1 ENODATA (No data available)
> stat("/mnt/test/test/0220", {st_mode=S_IFDIR|0755, st_size=6, ...}) = 0
> getxattr("/mnt/test/test/0220", "user.SAMBA_PAI", 0x1207f0aa0, 1024) = -1
> ENODATA (No data available)
> 
> For every folder it wants to delete, it walks all the folders doing this.
> So for 4k folders we get 16 milion such tests, which take waay too much
> time. Are these loops necessary? Can they be optimised?
> 
> We've tested ext3+acl and xfs as an underlying filesystem, with no
> difference. We also noticed this behaviour on win98 as a client.
> 
> Tested on 3.0.2a and 3.0.4, smb.conf attached.
> 

More discoveries here:

I have folder 'test' with 4k folders named from 0001 to 4096 (seq -w 4096
fed to mkdir). If i select folder 'test' and delete it, the 'preparing to
delete' stage takes just seconds and the delete itself takes about 160s,
which is about right.

BUT if i open folder 'test', select all of the directories there and try to
delete them, it takes almost half an hour to get the conformation dialog
box, while smbd process is doing what above strace shows and eating all the
available cpu.

Any ideas why?

-- 

Jure Pečar


More information about the samba-technical mailing list