[Dovecot] More efficient Deleting of a whole folder (or Purging Trash)
Timo Sirainen
tss at iki.fi
Wed Jan 30 22:40:12 EET 2008
On Jan 29, 2008, at 6:03 PM, Daniel Watts wrote:
> Is there not a more efficient way to do this? If Dovecot knows the
> whole folder is being deleted (ie a Trash purge), could it do
> something clever with the filesystem to just remove the whole folder?
If you use IMAP DELETE command, it renames the directory to ..DOVECOT-
TRASH (or something like it) and only after that it starts unlinking
the files. It wouldn't be too difficult to have this return success
immediately and then keep deleting the files on the background. I'm
not sure if this is worth the trouble though. It would also be
possible to do this as a plugin.
> Incidently, the command that initially deleted those 35k messages to
> Trash took about 1 hour to complete on my server and effectively
> locked my account out for all that time. There were also an awlful
> lot of these output from my strace:
>
> nanosleep({0, 131475000}, NULL) = 0
> lstat("/home/virtual/xxx.com/home/admin/Maildir/.Folders.Porter/
> dovecot-uidlist.lock", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
You mean this was in the deleting process, or the other processes? The
deleting process should have kept the maildir locked while it was
deleting the files, so other processes were locked out. This is by
design and can't be changed, at least until I some day add inotify
support for maildir synchronization.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080130/e709bc49/attachment.bin
More information about the dovecot
mailing list