Too many open files
Shelley Waltz
shwaltz at cabm.rutgers.edu
Tue Nov 11 08:37:26 EST 2008
Rob McMahon wrote:
> Shelley Waltz wrote:
>> Oddly enough I had the identical issue today while trying to remove a
>> bunch of users. I am running cyrus-imapd-2.3.7-2.el5 on RHEL5.
>>
>> I used cyradm and did
>> sam user.x anyone c
>> dm user.x
>>
>> This worked fine for about 20 users, then I got the following in maillog
>> ...
>>
>> Nov 3 10:35:28 rr imap[16539]: IOERROR: opening quota file
>> /var/lib/imap/quota/x/user.x: Too many open files
>> Nov 3 10:35:28 rr imap[16539]: DBERROR: error fetching user.x: cyrusdb
>> error
>> Nov 3 10:35:28 rr imap[16539]: Deleted mailbox user.x
>>
>> If I look in /var/spool/imap/x/user/ the directory and folders for user
>> x are still there. If I try to remove the mailbox once again using
>> cyradm, it claims the mailbox does not exist.
>>
>> How does one resolve this issue safely?
>>
>>
> I have the same problem with a few mailboxes myself, and don't know how
> to clean it up.
>
> To avoid the problem in the first place, if you have just a few (tens ?
> couple of hundred) users beginning with the same prefix, I think you can
> avoid the problem in the first place by putting e.g.
>
> imap cmd="imapd" listen="imap" prefork=0 maxfds=4096
>
> in /etc/cyrus.conf.
>
> I suspect the underlying cause is this chunk from
> lib/cyrusdb_quotalegacy.c(foreach):
>
> /* strip off the qr specific path and replace with pattern */
> sprintf(strstr(quota_path, FNAME_QUOTADIR) + strlen(FNAME_QUOTADIR),
> "?/%s*", prefix);
>
> /* search for the quotaroots */
> glob(quota_path, GLOB_NOSORT, NULL, &globbuf);
>
> That pattern on our boxes can match thousands of users. I think it
> needs to be more careful and go looking for `prefix' and `prefix.*', but
> I haven't dug into it far enough yet.
I changed the maxfds to 4096 and will try removing mailboxes once again.
>From my previous attempt described above, I still have
/var/spool/imap/x/user/x with all the folders from the account in the
directory. There appears to be no other trace of the account. Is it safe
to just rm the var/spool/imap/x/user/x directory contents?
I have a replica using sync_client which shows no trace whatsoever of
the account, so it seems a safe bet, yes?
thanks S
More information about the Info-cyrus
mailing list