[SOGo] Thousands of messages in the inbox and performance problem (memory)

2014-10-14 Thread Frantisek Kucera
Hello,

When one of my users tries to log in, he gets 502 Proxy error.
In the background, the sogod process is killed by OOM killer:

 Memory cgroup out of memory: Kill process 11811 (sogod) score 962 or 
 sacrifice child
 Killed process 11811 (sogod) total-vm:1385268kB, anon-rss:1006060kB, 
 file-rss:0kB

When I stop Dovecot, the user can login (but obviously can't use e-mail).
After some debugging I realized that there was more than 30 000 messages in his 
inbox.
I understand that this is huge amount of e-mails and not a typical use case, 
but I hope that SOGo could behave stable even in such cases.
When I added some swap, sogod ate about 4 GB of memory and then run out of it.
However the filesystem is not slow – directory listing time:

 # time ls -l | wc -l
 32574
 
 real0m0.362s
 user0m0.170s
 sys 0m0.195s

and total size of given e-mails is not too much:

 # du .
 169M

So why is not 4 GB of RAM enough to show list of messages? Of course, there are 
some metadata and MIME messages are parsed, not only raw data…
Maybe there could be some configurable limit of messages above which SOGo will 
refuse listing particular folder but will not eat all memory.

BTW: My SxVMemLimit has default value (384). I tried to increase this value but 
it didn't help.

Regards,
Franta

P.S. my solution was deleting the messages (most of them was useless 
notifications), so this request is not urgent – but maybe there is some bug or 
some place for improvement.
P.P.S. despite this issue, thanks for SOGo, the great groupware software!
-- 
users@sogo.nu
https://inverse.ca/sogo/lists

Re: [SOGo] Thousands of messages in the inbox and performance problem (memory)

2014-10-14 Thread Sven Schwedas
On 2014-10-14 17:14, Frantisek Kucera wrote:
 Hello,
 
 When one of my users tries to log in, he gets 502 Proxy error.
 In the background, the sogod process is killed by OOM killer:
 
 Memory cgroup out of memory: Kill process 11811 (sogod) score 962 or 
 sacrifice child
 Killed process 11811 (sogod) total-vm:1385268kB, anon-rss:1006060kB, 
 file-rss:0kB
 
 When I stop Dovecot, the user can login (but obviously can't use e-mail).
 After some debugging I realized that there was more than 30 000 messages in 
 his inbox.
 I understand that this is huge amount of e-mails and not a typical use case, 
 but I hope that SOGo could behave stable even in such cases.

Curious, it should – our mail servers have 2 GiB RAM each that's shared
between the IMAP and SOGo dæmons, and several users have mailboxes with
20k mails each and I've never ran into memory pressure. A problem with
Dovecot, maybe? (We're using Cyrus.)

 When I added some swap, sogod ate about 4 GB of memory and then run out of it.
 However the filesystem is not slow – directory listing time:
 
 # time ls -l | wc -l
 32574

 real0m0.362s
 user0m0.170s
 sys 0m0.195s
 
 and total size of given e-mails is not too much:
 
 # du .
 169M
 
 So why is not 4 GB of RAM enough to show list of messages? Of course, there 
 are some metadata and MIME messages are parsed, not only raw data…
 Maybe there could be some configurable limit of messages above which SOGo 
 will refuse listing particular folder but will not eat all memory.
 
 BTW: My SxVMemLimit has default value (384). I tried to increase this value 
 but it didn't help.
 
 Regards,
 Franta
 
 P.S. my solution was deleting the messages (most of them was useless 
 notifications), so this request is not urgent – but maybe there is some bug 
 or some place for improvement.
 P.P.S. despite this issue, thanks for SOGo, the great groupware software!
 

-- 
Mit freundlichen Grüßen, / Best Regards,
Sven Schwedas
Systemadministrator
TAO Beratungs- und Management GmbH | Lendplatz 45 | A - 8020 Graz
Mail/XMPP: sven.schwe...@tao.at | +43 (0)680 301 7167
http://software.tao.at



signature.asc
Description: OpenPGP digital signature


Re: [SOGo] Thousands of messages in the inbox and performance problem (memory), unexpected envelope address

2014-10-14 Thread Frantisek Kucera
Dne Út 14. října 2014 17:44:56, Sven Schwedas napsal(a):
 Curious, it should – our mail servers have 2 GiB RAM each that's shared
 between the IMAP and SOGo dæmons, and several users have mailboxes with
 20k mails each and I've never ran into memory pressure. A problem with
 Dovecot, maybe? (We're using Cyrus.)

I found a warning in the log just before killing: unexpected envelope address

 2014-10-14 11:49:20.013 sogod[7723] Note: using 'UCS-2LE' on Linux.
 Oct 14 11:49:20 sogod [7723]: [WARN] 
 0x0x7f26a8fcccb0[UIxEnvelopeAddressFormatter] unexpected envelope address: 
 0x0x7f26a930cf00[NGImap4EnvelopeAddress]:
 Oct 14 11:49:21 sogod [7702]: 0x0x7f26a6e03450[WOWatchDogChild] child 7723 
 exited
 …
 Oct 14 11:50:06 sogod [7702]: 0x0x7f26a6d71a80[WOWatchDog] all children 
 exited. We now terminate.
 Oct 14 11:50:07 sogod [7888]: version 2.2.9a (build @shiva.inverse 
 201409291610) -- starting
 Oct 14 11:50:07 sogod [7888]: vmem size check enabled: shutting down app when 
 vmem  384 MB
 Oct 14 11:50:07 sogod [7888]: 0x0x7f2eaf81d7d0[SOGoProductLoader] SOGo 
 products loaded from '/usr/lib/GNUstep/SOGo':

Maybe it's not about the number of messages?

Regards,
Franta






-- 
users@sogo.nu
https://inverse.ca/sogo/lists

Re: [SOGo] Thousands of messages in the inbox and performance problem (memory)

2014-10-14 Thread Ludovic Marcotte

On 2014-10-14 11:14 AM, Frantisek Kucera wrote:

When I stop Dovecot, the user can login (but obviously can't use e-mail).
After some debugging I realized that there was more than 30 000 messages in his 
inbox.
What version of Dovecot are you using? Do you have IMAP SORT enabled and 
advertised in IMAP capabilities?


--
Ludovic Marcotte
lmarco...@inverse.ca  ::  +1.514.755.3630  ::  http://inverse.ca
Inverse inc. :: Leaders behind SOGo (http://sogo.nu) and PacketFence 
(http://packetfence.org)

--
users@sogo.nu
https://inverse.ca/sogo/lists


Re: [SOGo] Thousands of messages in the inbox and performance problem (memory)

2014-10-14 Thread Frantisek Kucera
P.S. my Dovecot version is 2.1.7

Franta
-- 
users@sogo.nu
https://inverse.ca/sogo/lists


Re: [SOGo] Thousands of messages in the inbox and performance problem (memory), IMAP SORT capability

2014-10-14 Thread Frantisek Kucera
Dne Út 14. října 2014 12:55:12, Ludovic Marcotte napsal(a):
 On 2014-10-14 11:14 AM, Frantisek Kucera wrote:
  When I stop Dovecot, the user can login (but obviously can't use e-mail).
  After some debugging I realized that there was more than 30 000 messages in 
  his inbox.
 What version of Dovecot are you using? Do you have IMAP SORT enabled and 
 advertised in IMAP capabilities?

I hope so – KMail shows me that server supports these:

IMAP4REV1
LITERAL+
SASL-IR
LOGIN-REFERRALS
ID
ENABLE
IDLE
SORT
SORT=DISPLAY
THREAD=REFERENCES
THREAD=REFS
MULTIAPPEND
UNSELECT
CHILDREN
NAMESPACE
UIDPLUS
LIST-EXTENDED
I18NLEVEL=1
CONDSTORE
QRESYNC
ESEARCH
ESORT
SEARCHRES
WITHIN
CONTEXT=SEARCH
LIST-STATUS
SPECIAL-USE
QUOTA
ACL
RIGHTS=TEXK

But when I tried manually, I got:

 # telnet hostitel imap
 Trying 192.168.122.1...
 Connected to hostitel.
 Escape character is '^]'.
 * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE 
 STARTTLS LOGINDISABLED] Dovecot (Ubuntu) ready.
 1 capability
 * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE 
 STARTTLS LOGINDISABLED
 1 OK Pre-login capabilities listed, post-login capabilities have more.

I have backup of that deleted messages, so I can tune my servers and try to 
reproduce it. Or I can grep through the messages, if it is caused by some bad 
header („unexpected envelope address“).

Regards,
Franta
-- 
users@sogo.nu
https://inverse.ca/sogo/lists