Dovecot and the “Too many open files” error

EDIT: This method is not sufficient. See below for update!

I recently switched our mailserver from Gentoo and Courier-IMAP to CentOS 5.6 and Dovecot, which all went pretty smooth, until this weekend :) Dovecot wasn’t accepting logins anymore, and a quick look at the logs revealed the following:

May 30 09:06:17 mx1 dovecot: pipe() failed: Too many open files
May 30 09:06:17 mx1 dovecot: Temporary failure in creating login processes, slowing down for now

This is due to the standard max. open files limit of 1024, and was solved rather quickly by adding the following to /etc/security/limits.conf:

*                soft    nofile          8192
*                hard    nofile          63536

This increases the system-wide maximum of open files to a soft limit of 8192 files, and a hard limit of 63536 files. Restart Dovecot and verify the new limit is in effect with the following command:

cat /proc/`pidof dovecot`/limits |grep files

It should give the following output:

Max open files 8192 63536 files


It seems this method does not work as well as i thought it would. I found a better and much quicker/easier way to fix this. Just edit /etc/sysconfig/dovecot and change it to:

# Here you can specify your dovecot command line options.

# Increase max open files for dovecot process
ulimit -n 4096

Restart dovecot and you’re all set. Don’t forget to revert the changes to /etc/security/limits.conf if you altered this file.

  1. Dovecot e il problema “Too many open files” | gabcicala - pingback on July 1, 2011 at 12:57 pm
  2. Magnificent beat ! I would like to apprentice even as you amend your
    site, how can i subscribe for a blog site? The account helped me a acceptable deal.
    I have been a little bit acquainted of this your broadcast provided shiny clear idea

  3. I am now not sure the place you are getting your info, but good topic.

    I must spend some time finding out more or figuring out more.
    Thank you for excellent info I used to be looking for this information for my mission.

  4. Hi, Neat post. There is an issue together with your site in internet explorer, may test this IE nonetheless is the marketplace leader and a huge part of folks will leave out your magnificent writing because of this problem. dbffbeckgfed

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks and Pingbacks: