Too many open files

Rob McMahon Rob.McMahon at warwick.ac.uk
Mon Nov 3 11:19:39 EST 2008


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



More information about the Info-cyrus mailing list