Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Oct 01, 2009 2:52 pm 
Offline
Senior Newbie

Joined: Thu Oct 01, 2009 2:31 pm
Posts: 6
Hi,

I have had this error twice within +/- one month:
Quote:
Sep 30 15:16:52 nix dovecot: deliver(user@domain.com): open(/home/vmail/domain.com/user/maildirsize) failed: Too many open files


I need to restart dovecot and wait for the mailqueue to empty to make things work again.

Googling this error lead me to think I needed to increase the maximum open files, however, in a standard working situation, I am far from the limit:
Code:
# cat /proc/sys/fs/file-nr
1792   0   35041
# lsof -n | wc -l
3742


not sure why these figures are different, but anyhow, far from the 35041 files allowed.

proc(5) also lead me to cat /proc/sys/fs/inode-max but I have no such file on my linode (nor on my workstations).

I have asked to be moved to a newer host quite recently (now on newark157) as I had problems with 2.6.18 kernel and ntp. Not sure if this is related but I had never encountered such issues before.

I have no specific policy defined in /etc/security/limits.conf

Any idea?

Thanks in advance for your help!

Cheers,
Julien


Top
   
 Post subject:
PostPosted: Fri Oct 02, 2009 2:07 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Sounds like if it were hitting the system-wide limit found in /proc, you'd get a slightly different error message.

I'd suspect that there is a ulimit set for the user Dovecot is running as. Note that /etc/security/limits.conf isn't the only place to look, but I'll be damned if I can figure out where the limits are being set on my system (it's not /etc/profile).


Top
   
 Post subject:
PostPosted: Fri Oct 02, 2009 12:27 pm 
Offline
Senior Newbie

Joined: Thu Oct 01, 2009 2:31 pm
Posts: 6
Hi, thanks for your reply.

Unfortunately, this is not my issue:
Code:
dovecot@nix:~$ ulimit 
unlimited


I am reluctant to raise the maximum open files for the whole system as I only run a small server for 2 users (smtp/imap/http) hence I doubt I reach the limits set by Linode... even a Linode360.

Any other hints?

Cheers,
Julien


Top
   
 Post subject:
PostPosted: Fri Oct 02, 2009 2:05 pm 
Offline
Senior Member

Joined: Wed Feb 13, 2008 2:40 pm
Posts: 126
Try "ulimit -n". "ulimit" implies "-f" which is the maximum size of files written by the shell and its children; -n is the maximum number of open file descriptors.


Top
   
 Post subject:
PostPosted: Fri Oct 02, 2009 2:50 pm 
Offline
Senior Newbie

Joined: Thu Oct 01, 2009 2:31 pm
Posts: 6
You are right, I wasn't aware of this!

It gives
Code:
dovecot@nix$ ulimit -n
1024


It is the same for all other users I have tried.
Not sure where this limit comes from. A default kernel setting?

but again, in a "standard" situation (ie. when everything is working), I am far from this limit:
Code:
# lsof -nu dovecot | wc -l
87


One strange thing is that the apache user has 1502 open files, despite the limit set to 1024.
lsof also accounts for network files, which might not be taken into account in these limits.

Cheers,
Julien


Top
   
 Post subject:
PostPosted: Mon Oct 05, 2009 11:52 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
ulimit is set per-account, so the user being used by apache may have a different limit set.


Top
   
 Post subject:
PostPosted: Mon Oct 05, 2009 12:07 pm 
Offline
Senior Newbie

Joined: Thu Oct 01, 2009 2:31 pm
Posts: 6
www-data (user running apache) also has a limit set to 1024.

As for my main issue, I think (though requires more testing) it was due to a bug in the development version of DSPAM, which left numerous open pipes.

Cheers,
Julien


Top
   
 Post subject:
PostPosted: Mon Oct 05, 2009 3:00 pm 
Offline
Senior Member

Joined: Wed Feb 13, 2008 2:40 pm
Posts: 126
What are the contents of /etc/security/limits.conf ?

Search /etc/* for "ulimit"


Top
   
 Post subject:
PostPosted: Tue Oct 06, 2009 12:44 am 
Offline
Senior Newbie

Joined: Thu Oct 01, 2009 2:31 pm
Posts: 6
Hi,

/etc/security/limits.conf is empty (if I remove the default comments of course).

Nothing intersting in /etc :
Code:
# rgrep -i ulimit /etc/
logcheck/ignore.d.server/mldonkey-server:^\w{3} [ :0-9]{11} [._[:alnum:]-]+ mlnet_error: [/[:digit:]]{10} [:[:digit:]]{8} \[cO\] Language [[:upper:]]+, locale [-_.[:alnum:]]+, ulimit for open files [[:digit:]]+$
/etc/login.defs:#ULIMIT


Cheers,
Julien


Top
   
 Post subject:
PostPosted: Tue Oct 06, 2009 12:50 am 
Offline
Senior Newbie

Joined: Thu Oct 01, 2009 2:31 pm
Posts: 6
JulienV wrote:
www-data (user running apache) also has a limit set to 1024.


Hum... I was not checking on the right server! Sorry for this.

And you are right, www-data has no limits ("unlimited").

Cheers,
Julien


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group