Cyrus 2.2.8: imapd dies + corrupt inbox
Andrew Morgan
morgan at orst.edu
Fri Feb 18 13:14:31 EST 2005
On Fri, 18 Feb 2005, Bernd Nies wrote:
> Hi again,
>
> These crashes are caused because cyrus runs out of file descriptors:
>
>
> Feb 18 14:37:51 mailsrv lmtpunix[25178]: [ID 136705 local6.error]
> IOERROR: opening /var/spool/adnmail/cyrus/mail/dev/a2k-dev/cyrus.cache:
> Too many open files
> Feb 18 14:37:51 mailsrv lmtpunix[25178]: [ID 860734 local6.debug]
> verify_user(dev.a2k-dev) failed: System I/O error
> Feb 18 14:38:03 mailsrv imap[546]: [ID 299345 local6.debug] SQUAT failed
> to open index file
> Feb 18 14:38:03 mailsrv imap[546]: [ID 418793 local6.debug] SQUAT failed
> Feb 18 14:38:30 mailsrv master[19603]: [ID 970914 local6.error] process
> 6771 exited, signaled to death by 11
> Feb 18 14:38:30 mailsv master[19603]: [ID 621917 local6.debug] service
> imaps pid 6771 in BUSY state: terminated abnormally
> Feb 18 14:38:43 mailsrv master[19603]: [ID 970914 local6.error] process
> 1326 exited, signaled to death by 11
>
> A couple of days ago I increased the default file descriptor settings in
> /etc/system from default
>
> set rlim_fd_cur=1024
> set rlim_fd_max=4096
>
> to
>
> set rlim_fd_cur=32768
> set rlim_fd_max=65536
>
> But recently Cyrus ran out again of file descriptors.
>
> Tuning guides tell that it is dangerous to increase these default values:
>
> http://docs.sun.com/source/817-6255/SystemTuning.html
> http://www.princeton.edu/~psg/unix/solaris/troubleshoot/filedesc.html
>
> We have about 100 concurrent imap users and some of them have more than
> 10000 mails in a folder. Postfix runs on the same host and delivers the
> mails through a lmtp socket.
>
> Could it possibly be that Cyrus may not close correctly every file after
> accessing it and therefore runs out of file descriptors? Or what is the
> recommended setting?
I have greatly increased the file handle limits on my linux Cyrus server
with no adverse consequences. In my Cyrus init script I have:
# Crank up the file limits
ulimit -n 209702
ulimit -u 2048
This is probably overkill, but on a moderately loaded system you can
expect Cyrus to use more than 1024 file handles easily:
[root at mail1 ~]# cat /proc/sys/fs/file-nr
21818 3984 209702
I would assume that programs on Linux would suffer from the same problems
with stdio and select() calls as on Solaris, but I haven't had any trouble
so far. My guess is that Sun placed that warning to cover legacy programs
that can't handle larger limits.
Andy
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
More information about the Info-cyrus
mailing list