Current User: Guest Login Register
Please consider registering


Register? | Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Dovecot hangs sometimes

Reply to Post Add a New Topic
UserPost

10:42 am
December 3, 2009


mariogomide

Guest

Hello Consultant!

It´s me again! :D

I followed this article to set up my mail server: http://www.linuxmail.info/post…..-centos-5/. I also configured secure IMAP, POP3 and SMTP (on another server) with SSL.

Overall, everything works fine. I´ve got about 8k users which most of them use POP3 but there is a large portion of users that user IMAP and Webmail.

Users are able to send and receive email authenticating agaisnt a Win2k3 Active Directory + secured connections with SSL.

Besides some other problems (that I posted in this forum), there is a problem that dovecot hangs at times. It may be a coincidence, but it happens everyday at about 9:00/9:30am, 11:20am, 1:50pm and 2:30pm (as far as I have monitored/been told), which are the hours that users come to work and return from lunch break.

When dovecot hangs, i restart its service and all is good again. I used to think that my AD was being overwelmed with authentication (regular windows login and dovecot), but I installed a new AD server on Win2k3 Enterprise Edition 64bits on a new and powerfull hardware and the problem persists.

My mail server is installed on an identical hardware with RHEL 5.4 64bits. Dovecot 1.0.7, Postfix 2.3.3.

Thanks a lot in advance!!

Mario Gomide

7:12 pm
December 3, 2009


consultant

Admin

posts 341

Hi Mario,

Since you are using Active Directory, please use Kerberos authentication instead of LDAP authentication. There are a lot of problem with LDAP authentication and this is one of them.

7:44 am
December 11, 2009


mariogomide

Guest

Hey Consultant!

Well, I changed the authentication method to Kerberos and it works fine. But dovecot still hangs at times…

I really don't know what else I could do. As a lousy workaround, I made a script that restarts dovecot everyday at 9am and 2pm.

I don't think this is the issue, but I got about 7000 users that I suppose dovecot can handle perfectly even with SSL.

Thanks again!

Mario

11:53 pm
December 11, 2009


terry

Member

posts 3

normal dovecot hang is becoz of time sync to different source, configure your ntpd to sync with AD server should help. i experience dovecot hang when ntpd sync to external source resulted more than 5 second time change, dovecot will stop by itself.

http://wiki.dovecot.org/TimeMo…..dBackwards

1:38 pm
December 28, 2009


mariogomide

Guest

Hello again!

Well, I didn't have a time syncronization problem, but thanks for the advise.

I changed my structure to a new server, and so far so good. Still no problems with dovecot hanging.

I made some interesting chages:

Dovecot now uses passdb pam instead of passdb ldap;

System doesn't use samba, nor winbind nor changes in nsswitch;

Dovecot no longer hangs (considering that this is end-of-the-year period, and people here usually don't check their emails and stuff, lots of people in vacation, so the load is a lot lower).

Thanks!

Mario

7:19 am
January 5, 2010


mariogomide

Guest

Hello there,

Bad news, folks…

For a week I had a perfect server with no flaws or slow processing.

Yesterday (monday, first working day of the year) I had problems with dovecot hanging again, but this time only in the morning.

The problem seems strange and it looks like dovecot has been having problems with IMAPs and not with POP3s. Well, I'm not really sure about what I just said… Anyways, does dovecot have a limitation of concurrent users or something like that?

What would cause it to hang for about 10 minutes? A user with a "broken" /home directory in file system logging in, perhaps?

Any ideas?

Thanks!

Mario

9:01 am
January 5, 2010


consultant

Admin

posts 341

Hi Mario,

Since you are now using Kerberos, we can cross it out. If you are sure it's not due to time synchronization as pointed out by Terry, we can also cross it out. How about the log file, does it contain anything suspicious?

1:02 pm
January 5, 2010


mariogomide

Guest

Not really… I keep checking the log, but there are A LOT of entries. But as far as I looked, nothing so unusual.

I discovered something when the problem happened again this afternoon. Dovecot doesn't hang completely. I mean, Outlook (and Thunderbird) users still can connect, but webmail is slow…. super slow! Eventually, if I wait longer Outlook won't connect anymore. So there is this period where the clients work but are slow. After that, dovecot hangs.

In maillog I keep getting this at times (both rip=127.0.0.1 and rip=network-ip-address)

Jan 5 15:02:15 myhost dovecot: imap-login: Disconnected: Shutting down: rip=127.0.0.1, lip=127.0.0.1, TLS handshake

Another thing I see a lot specially right before restarting dovecot is a lot of people disconnecting:

dovecot: IMAP(user): Connection closed

dovecot: IMAP(user): Disconnected: Logged out

I also get this error several times a day:

dovecot: imap-login: SSL_accept() failed: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol [IP ADDRESS]

Otherwise, the log file seams to be OK. I haven't seen anything unusual right before the hanging so far. I'll be taking closer looks. Which log analyser could I use to make it easier?

1:59 pm
January 7, 2010


mariogomide

Guest

Ok, after some research, it seems that the problem is related to the maximum number of open file descriptors.

I noticed I have tons of these mesagens in maillog:

dovecot: imap-login: SSL_write() syscall failed: Bad file descriptor [127.0.0.1]

I got about 8000 users, connecting via SSL (POP3 and IMAP) + webmail connections.

But the question is: Should I do anything with dovecot? Is it only increasing 'ulimit -n'? Any other recommendactions?

Thanks!

5:57 pm
January 7, 2010


consultant

Admin

posts 341

It is not about the number of file descriptor. And yes you should change something in Dovecot, try setting the login_process_size to 64. See http://wiki.dovecot.org/LoginProcess for more details.

11:43 am
January 8, 2010


mariogomide

Guest

Hey,

My login_process_size is already set to 64, but login_max_processes_count was at 128.

Then I issued the following command every second:

ps -ef | grep imap-login | grep dovecot | wc -l

The results were in between 149 and 152.

and my webmail already was starting to get slow at this time (2:24pm) and dovecot is about to hang.

I changed login_max_processes_count to 256 and restarted dovecot. Ten minutes after, my processes are increasing slowly. All is fine (as usual after I restart dovecot).

Hope this fixes the problem. The next "hanging" would be on monday at about 9:40am.

8:34 am
January 9, 2010


consultant

Admin

posts 341

Great :-) Tell us if it works.

3:32 pm
January 11, 2010


mariogomide

Guest

Great news, folks!

So far, the mail server is working fine, with no problems at all.

I think the problem is solved!!!! Laugh

If I have trouble or if something went bad, I'll let you know!

Thanks a lot again!

Mario

6:53 am
January 12, 2010


consultant

Admin

posts 341

Great, so it was the login_process_count that fixed it. This is a very interesting case.

Reply to Post

Reply to Topic:
Dovecot hangs sometimes

Guest Name (Required):

Guest Email (Required):

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
11 + 2
   


About the Linux Mail Server Setup and Howto Guide Forum

Forum Timezone: America/New_York

Most Users Ever Online: 60

Currently Online:
14 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 5
Topics: 326
Posts: 1012

Membership:

There are 928 Members
There have been 84 Guests

There is 1 Admin

Top Posters:

shanmugasundaram s – 45
Kendermin – 15
Ginger – 14
bighorn – 14
iron_michael86 – 12
Raminda – 11

Recent New Members: RaHuL, bikesh, pappy_says, geos, boudi7, dara.hr

Administrators: consultant (341 Posts)