On 09/27/10 15:48, Timo Sirainen wrote:
On Mon, 2010-09-27 at 10:09 +0200, Attila Nagy wrote:
I've tried to set the above in Dovecot 2.0.3, but according to ktrace (FreeBSD) it still fsync()s a lot (pop3 processes for example). Is this switch useful at all? I did a quick test and didn't see any fsyncs. Can you find out what file it's fsyncing? doveconf -n output could also be useful. doveconf -n: # 2.0.4: /usr/local/etc/dovecot/dovecot.conf # OS: FreeBSD 8.1-STABLE amd64 auth_cache_size = 104857600 auth_cache_ttl = 86400 s disable_plaintext_auth = no mail_fsync = never mail_gid = 999 mail_location = maildir:~/Maildir mail_plugins = $mail_plugins quota [...]
Should I set mail_fsync for only pop and imap instances? Currently I don't use Dovecot's lmtp or deliver, but will, so there I can't allow disabling fsync. I don't like setting this to never, but after a migration from courier, the machine couldn't handle the load with fsync, so this is a must.
The files:
69524 pop3 1285595867.816137 CALL
open(0x801004f08,O_RDWR|O_CREAT|O_EXCL,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
69524 pop3 1285595867.816153 NAMI
"/home/hm01/16/12/user1/Maildir/temp.hm01.69524.579c9846c8ec2b26"
69524 pop3 1285595867.816238 RET open 9
[...]
69524 pop3 1285595867.816596 CALL fstat(0x9,0x7fffffffe4a0)
69524 pop3 1285595867.816608 STRU struct stat {dev=2188960719,
ino=263529548, mode=-rw------- , nlink=1, uid=999, gid=999, rdev=0,
atime=1285595867.815852103, stime=1285595867.815852103,
ctime=1285595867.815852103, birthtime=1285595867.815852103, size=0,
blksize=131072, blocks=1, flags=0x0 }
69524 pop3 1285595867.816620 RET fstat 0
[...]
69524 pop3 1285595867.822932 CALL fstat(0x9,0x7fffffffe570)
69524 pop3 1285595867.822955 STRU struct stat {dev=2188960719,
ino=263529548, mode=-rw------- , nlink=1, uid=999, gid=999, rdev=0,
atime=1285595867.815852103, stime=1285595867.815852103,
ctime=1285595867.815852103, birthtime=1285595867.815852103, size=0,
blksize=131072, blocks=1, flags=0x0 }
69524 pop3 1285595867.822974 RET fstat 0
[...]
69524 pop3 1285595867.823065 CALL write(0x9,0x8016d1200,0x5)
69524 pop3 1285595867.823116 GIO fd 9 wrote 5 bytes
"Trash"
69524 pop3 1285595867.823134 RET write 5
69524 pop3 1285595867.823148 CALL write(0x9,0x8006f5be3,0x1)
69524 pop3 1285595867.823173 GIO fd 9 wrote 1 byte
"
"
69524 pop3 1285595867.823186 RET write 1
69524 pop3 1285595867.823198 CALL write(0x9,0x8016d1206,0x6)
69524 pop3 1285595867.823220 GIO fd 9 wrote 6 bytes
"Drafts"
[...]
69524 pop3 1285595867.829999 CALL fsync(0x9)
69524 pop3 1285595868.119406 RET fsync 0
[...]
69524 pop3 1285595868.129605 CALL close(0x9)
69524 pop3 1285595868.129674 RET close 0
BTW, just curious, what is the rationale of the two fstats so close together? I've searched for some more examples and each of them were like this one. It seems that Dovecot copies the subscriptions file to this temporary file and then fsyncs it. And the question also arises: why? And more specifically: why in a pop3 server?
Thanks,