Too many open files

Shelley Waltz shwaltz at cabm.rutgers.edu
Mon Nov 3 12:07:16 EST 2008


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?

S.Waltz


Rob McMahon wrote:
> Rob McMahon wrote:
>> Cyrus-2.2.13 (yes, I know it's getting on a bit).  Solaris 10 SPARC,
>> around 115,000 mailboxes.
>>
>> I was mopping up a few users today with a script which basically does:
>>
>> while (<>) {
>>   chomp;
>>   my $mb = 'user.' . $_;
>>   $client->setacl($mb, $user => 'c');
>>   $client->delete($mb);
>> }
>>
>> After deleting just a few, I start getting errors like "Must login
>> first", "System I/O Error" (sorry, I haven't got the exact messages to
>> cut & paste).  Looking in the logs I see:
>>
>> Aug 24 16:20:44 narcissus imap[24338]: [ID 240394 local6.error] IOERROR:
>> opening quota file /var/imap/quota/V/user.??????.Trash: Too many open
>> files
>> Aug 24 16:21:38 narcissus imap[24338]: [ID 816447 local6.error] warning:
>> cannot open /etc/hosts.deny: Too many open files
>>
>> and indeed this process has hit the default 256 limit, most of which
>> seem to be quota files.  Other issues were manifesting, IMAP commands
>> never completing for instance, so I had to kill this process, which in
>> turn caused the master process to restart.  Not good.
>>
>>
> I think I've just found an answer to this.  Looking at the files open by
> one of these processes (I'd upped descriptors to 2048), it appears that
> if you try to delete, say, user.a, the IMAP process ends up quota files
> for every user beginning with a "a" ... sounds mad but that is what I've
> observed, and if I'm careful about not deleting short names it goes
> through okay.  I'll try to investigate further.  I know this is old
> code, and the algorithms have probably changed by now.
>
> Cheers,
>
> Rob
>
> --
> E-Mail:	Rob.McMahon at warwick.ac.uk		PHONE:  +44 24 7652 3037
> Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England
>
> ----
> Cyrus Home Page: http://cyrusimap.web.cmu.edu/
> Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
> List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
>




More information about the Info-cyrus mailing list