1 message in net.sourceforge.lists.courier-users[courier-users] Ubuntu + courier + ga...
FromSent OnAttachments
Pavel GeorgievNov 16, 2007 5:49 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] Ubuntu + courier + gam_server + squirrelmail problemActions...
From:Pavel Georgiev (pav@netclime.com)
Date:Nov 16, 2007 5:49:19 am
List:net.sourceforge.lists.courier-users

Hi list,

I have the following setup - Ubuntu 6.06, postfix + courier + squirrelmail and mailboxes on a nfs share. I have two such nodes with a load balancer in front.

The problem that I`m hitting sometimes it that the imapd daemon takes too much time to scan a mailbox, even if it is empty.

I strace-d the imapd daemon few times and here is what I found:

[pid 3628] 05:12:49.870364 close(3) = 0 [pid 3628] 05:12:49.870453 socket(PF_FILE, SOCK_STREAM, 0) = 3 [pid 3628] 05:12:49.870536 connect(3, {sa_family=AF_FILE, path=@/tmp/fam-vmail-}, 110) = -1 ECONNREFUSED (Connection refused) [pid 3628] 05:12:49.870643 close(3) = 0 [pid 3628] 05:12:49.870717 access("/usr/lib/gamin/gam_server", R_OK|X_OK) = 0 [pid 3628] 05:12:49.870807 fork(Process 3630 attached ) = 3630 [pid 3628] 05:12:49.871450 waitpid(3630, Process 3628 suspended <unfinished ...> [pid 3630] 05:12:49.871571 getpid() = 3630 [pid 3630] 05:12:49.871643 getrlimit(RLIMIT_STACK, {rlim_cur=2044*1024, rlim_max=RLIM_INFINITY}) = 0 [pid 3630] 05:12:49.871722 setrlimit(RLIMIT_STACK, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 [pid 3630] 05:12:49.871977 getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=1024}) = 0 [pid 3630] 05:12:49.872048 fcntl64(0, F_SETFD, FD_CLOEXEC) = 0 [pid 3630] 05:12:49.872110 fcntl64(1, F_SETFD, FD_CLOEXEC) = 0 [pid 3630] 05:12:49.872167 fcntl64(2, F_SETFD, FD_CLOEXEC) = 0 [pid 3630] 05:12:49.872224 fcntl64(3, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor) [pid 3630] 05:12:49.872285 fcntl64(4, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor) [pid 3630] 05:12:49.872344 fcntl64(5, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor) [pid 3630] 05:12:49.872403 fcntl64(6, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)

This goes on for few seconds (2-3) and then a gam_server process is forked and I get my reply from the server only when the gam_server exits which is 30 sec. That is when I access the mailbox via squirrelmail and I end up waiting 30+ sec to open a mailbox with 5 mails.

So question 1: 1) is there a way to optimize gam_server - is it better to run it with --notimeout on boot, does it make sense to use it at all with nfs shares? If yes - how to configure it so it monitors only the mailboxes, not the whole nfs share or /. If I dont need it for nfs - how to disable it (possible without rebuilding courier)?

The strange thing is that when I stop one of the nodes. I see that squirrelmail uses frames and makes a login for each frame, so a common scenario is that one frame hist the flirts server and the other hits the other server, and in this case each of the nodes makes a 30 sec pause when stracing imapd (which makes me think it may have something to do with gamin). Is there any lock that would prevent two processes accessing the same mailbox over nfs?

And question 2: