Results 1 to 8 of 8

Thread: Too many IMAP sessions, closing ImapSession {sessionID=...}

  1. #1
    marvin42 is offline Member
    Join Date
    Mar 2011
    Posts
    13
    Rep Power
    4

    Question Too many IMAP sessions, closing ImapSession {sessionID=...}

    Hi Guys!

    On both Zimbra OS 8.0.1 and 8.0.4 I have a problem with an Android mobile client (AquaMail):

    Around 15 folders are PUSHED on the mobile device, and the AquaMail client just syncs all the time through the folders.


    I checked mailbox.log and I found this a LOT of times:

    Code:
    2013-07-22 ###### INFO  [ImapSSLServer-1] [name=######@######;ip=##.##.##.##;ua=AquaMail/1.2.4.31;] session -Too many IMAP sessions, closing ImapSession{sessionId=22, accountId=######, lastAccessed=######}
    2013-07-22 ###### INFO  [SessionSweeper] [] imap - dropping connection for user######@###### (server-initiated)

    I've read through the forums and find suggetions for dropping connections, therefore I've increased some constants:

    Code:
    zimbra@mail:/home/zlaci$ zmlocalconfig -e imap_throttle_acct_limit=500
    zimbra@mail:/home/zlaci$ zmlocalconfig -e imap_throttle_ip_limit=500

    Code:
    zimbra@mail:/home/zimbra$ zmprov gs mail.mydomain.com | grep Threads
    zimbraAdminImapImportNumThreads: 20
    zimbraHttpNumThreads: 250
    zimbraHttpSSLNumThreads: 50
    zimbraImapNumThreads: 500
    zimbraLmtpNumThreads: 20
    zimbraMilterNumThreads: 100
    zimbraPop3NumThreads: 100
    zimbraScheduledTaskNumThreads: 20
    Code:
    zimbra@mail:/home/zimbra$ netstat -ant | grep 993 | wc -l
    16
    In the Admin GUI, Monitoring/Sessions shows 15-16 sessions only.

    My question is:
    Where can I increase the session limit (if there is any) or if there's another problem, where can I search for?

    Also, as an INFO, debug log of AquaMail is full with this:

    Code:
    2013.07.20 02:29:15.748 +0200	AquaMail	[NETWRK.470] ***** ERROR: Unable to connect to [XXXXXXXXXXXXX:993,]
    java.net.ConnectException: failed to connect to XXXXXXXXXXXXX/XX.XX.XX.XX (port 993) after 30000ms: isConnected failed: ECONNREFUSED (Connection refused)
    	at libcore.io.IoBridge.isConnected(IoBridge.java:224)
    	at libcore.io.IoBridge.connectErrno(IoBridge.java:161)
    	at libcore.io.IoBridge.connect(IoBridge.java:112)
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
    	at java.net.Socket.connect(Socket.java:842)
    	at org.kman.AquaMail.net.MailConnectionManager.acquire(MailConnectionManager.java:253)
    	at org.kman.AquaMail.mail.imap.ImapIdleStartupTask.initConnection(ImapIdleStartupTask.java:98)
    	at org.kman.AquaMail.mail.imap.ImapTask_ConnectLogin.ensureConnectLogin(ImapTask_ConnectLogin.java:33)
    	at org.kman.AquaMail.mail.imap.ImapTask_Sync.process(ImapTask_Sync.java:156)
    	at org.kman.AquaMail.mail.imap.ImapIdleStartupTask.process(ImapIdleStartupTask.java:34)
    	at org.kman.AquaMail.core.MailTaskExecutor.onTask(MailTaskExecutor.java:366)
    	at org.kman.AquaMail.core.MailTaskExecutor.run(MailTaskExecutor.java:342)
    	at java.lang.Thread.run(Thread.java:856)
    Caused by: libcore.io.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)
    	at libcore.io.IoBridge.isConnected(IoBridge.java:208)
    	... 13 more
    Thanks in advance!

    Laszlo

  2. #2
    marvin42 is offline Member
    Join Date
    Mar 2011
    Posts
    13
    Rep Power
    4

    Default

    Quote Originally Posted by marvin42 View Post
    Hi Guys!

    On both Zimbra OS 8.0.1 and 8.0.4 I have a problem with an Android mobile client (AquaMail):

    Around 15 folders are PUSHED on the mobile device, and the AquaMail client just syncs all the time through the folders.


    I checked mailbox.log and I found this a LOT of times:

    Code:
    2013-07-22 ###### INFO  [ImapSSLServer-1] [name=######@######;ip=##.##.##.##;ua=AquaMail/1.2.4.31;] session -Too many IMAP sessions, closing ImapSession{sessionId=22, accountId=######, lastAccessed=######}
    2013-07-22 ###### INFO  [SessionSweeper] [] imap - dropping connection for user######@###### (server-initiated)

    I've read through the forums and find suggetions for dropping connections, therefore I've increased some constants:

    Code:
    zimbra@mail:/home/zlaci$ zmlocalconfig -e imap_throttle_acct_limit=500
    zimbra@mail:/home/zlaci$ zmlocalconfig -e imap_throttle_ip_limit=500

    Code:
    zimbra@mail:/home/zimbra$ zmprov gs mail.mydomain.com | grep Threads
    zimbraAdminImapImportNumThreads: 20
    zimbraHttpNumThreads: 250
    zimbraHttpSSLNumThreads: 50
    zimbraImapNumThreads: 500
    zimbraLmtpNumThreads: 20
    zimbraMilterNumThreads: 100
    zimbraPop3NumThreads: 100
    zimbraScheduledTaskNumThreads: 20
    Code:
    zimbra@mail:/home/zimbra$ netstat -ant | grep 993 | wc -l
    16
    In the Admin GUI, Monitoring/Sessions shows 15-16 sessions only.

    My question is:
    Where can I increase the session limit (if there is any) or if there's another problem, where can I search for?

    Also, as an INFO, debug log of AquaMail is full with this:

    Code:
    2013.07.20 02:29:15.748 +0200	AquaMail	[NETWRK.470] ***** ERROR: Unable to connect to [XXXXXXXXXXXXX:993,]
    java.net.ConnectException: failed to connect to XXXXXXXXXXXXX/XX.XX.XX.XX (port 993) after 30000ms: isConnected failed: ECONNREFUSED (Connection refused)
    	at libcore.io.IoBridge.isConnected(IoBridge.java:224)
    	at libcore.io.IoBridge.connectErrno(IoBridge.java:161)
    	at libcore.io.IoBridge.connect(IoBridge.java:112)
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
    	at java.net.Socket.connect(Socket.java:842)
    	at org.kman.AquaMail.net.MailConnectionManager.acquire(MailConnectionManager.java:253)
    	at org.kman.AquaMail.mail.imap.ImapIdleStartupTask.initConnection(ImapIdleStartupTask.java:98)
    	at org.kman.AquaMail.mail.imap.ImapTask_ConnectLogin.ensureConnectLogin(ImapTask_ConnectLogin.java:33)
    	at org.kman.AquaMail.mail.imap.ImapTask_Sync.process(ImapTask_Sync.java:156)
    	at org.kman.AquaMail.mail.imap.ImapIdleStartupTask.process(ImapIdleStartupTask.java:34)
    	at org.kman.AquaMail.core.MailTaskExecutor.onTask(MailTaskExecutor.java:366)
    	at org.kman.AquaMail.core.MailTaskExecutor.run(MailTaskExecutor.java:342)
    	at java.lang.Thread.run(Thread.java:856)
    Caused by: libcore.io.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)
    	at libcore.io.IoBridge.isConnected(IoBridge.java:208)
    	... 13 more
    Thanks in advance!

    Laszlo

    An additional info:

    The above is from Zimbra 8.0.4 - which is a test server -, the production server runs Zimbra OS 8.0.1 with concurrent IMAP sessions > 50.

    The Too many Session problem appears on both servers but regarding only AquaMail.

    Is is because of a per IP / account or user limit or should I ask on the AquaMail forums because it not related to Zimbra?
    (However, the mailbox.log says ImapSSLServer complains about too many sessions).

    Any ideas?

    thx,

    Laszlo

  3. #3
    marvin42 is offline Member
    Join Date
    Mar 2011
    Posts
    13
    Rep Power
    4

    Default

    Also, disabling SSL makes no change, the Session dropping still exists, only difference is that there is ImapServer instead of ImapSSLServer.

    In addition, AquaMail (Imap Push client) keeps syncing (connecting) through the folders in an endless loop with a few seconds (20-40s) between rounds.

  4. #4
    marvin42 is offline Member
    Join Date
    Mar 2011
    Posts
    13
    Rep Power
    4

    Default

    Hi!

    OK, I see, it's not a trivial problem.

    If you need any additional info, log, whatever, please let me know.

    If there is no limit on sessions, or the settings are OK and it shouldn't drop connections, then tell me (I've read through the forums and find no more info).

    May I open a thread in Aquamail's forum?

    thanks,

    Laszlo

  5. #5
    sbala_kumar is offline Active Member
    Join Date
    Mar 2013
    Posts
    33
    Rep Power
    2

    Default

    Hi,

    Checkout the link How to disable POP3 throttling and see if changing the IMAP throttle value helps you out.

    Thanks
    Bala

  6. #6
    inqueue is offline Zimbra Employee
    Join Date
    Mar 2006
    Location
    Greenwood, IN
    Posts
    90
    Rep Power
    9

    Default

    Hi,

    Did you try tuning LC:zimbra_session_limit_imap? It defaults to 15.
    Code:
    zmlocalconfig -i zimbra_session_limit_imap
    zimbra_session_limit_imap:
    Maximum number of IMAP folders a single user can have open at once
    * Changes are in effect after server restart.
    
    zmlocalconfig zimbra_session_limit_imap
    zimbra_session_limit_imap = 15
    --
    Jason Bryan
    Zimbra R&D

  7. #7
    marvin42 is offline Member
    Join Date
    Mar 2011
    Posts
    13
    Rep Power
    4

    Default

    Hi!

    Bala, I've already set those values.

    Jason (inqueue), thanks for pointing this out, I've never read about this setting, but I am pretty sure this will solve the problem:
    Maximum number of IMAP folders a single user can have open at once
    <-- actually this is my issue.

    Just FYI:
    Since my first post, I've created test accounts and logged things with AquaMail as well. With one mobile client, at Aquamail is OK, even pushing 8-10 folders.
    But with more devices, the server starts to drop connections.

    OK, I've increased zimbra_session_limit_imap=50, I test it a bit and I will give a feedback.

    Thanks again,

    Laszlo

  8. #8
    marvin42 is offline Member
    Join Date
    Mar 2011
    Posts
    13
    Rep Power
    4

    Talking [SOLVED] IMAP Session dropped

    Hi!

    A little feedback now.

    For more than a week now I've been testing what inqueue suggested, namely increasing zimbra session limit by zimbra_session_limit_imap=50.

    I can confirm that this SOLVED the problem, sessions are not dropped any more.

    Based on other threads I previously increased other IMAP settings, like:


    Code:
    $ zmprov gs mail.mydomain.com | grep Threads 
    zimbraAdminImapImportNumThreads: 20 
    zimbraHttpNumThreads: 250 
    zimbraHttpSSLNumThreads: 50 
    zimbraImapNumThreads: 500 
    zimbraLmtpNumThreads: 20 
    zimbraMilterNumThreads: 100 
    zimbraPop3NumThreads: 100 
    zimbraScheduledTaskNumThreads: 20:D
    Actually, setting IMAP Session limit was the solution I was looking for, however, searching Google or Zimbra forums I've never met this settings.

    So, once again, thanks to inqueue for pointing this out.

    This thread can be marked as SOLVED.

    Thanks,
    Laszlo

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. Replies: 6
    Last Post: 08-28-2012, 05:10 AM
  2. IMAP server abruptly closing connection
    By Aragon in forum Administrators
    Replies: 3
    Last Post: 05-16-2012, 05:01 AM
  3. IMAP server abruptly closing connection
    By Aragon in forum Installation
    Replies: 0
    Last Post: 04-24-2012, 06:59 AM
  4. limit imap sessions for account
    By gvillari in forum Administrators
    Replies: 0
    Last Post: 10-06-2011, 02:34 AM
  5. Zimbra closing active IMAP connections
    By gharris@metacarta.com in forum Administrators
    Replies: 3
    Last Post: 01-30-2011, 09:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •