Closed nielspeen closed 2 years ago
@nielspeen Can you share the log before the few lines before getting killed ?
(using the latest git for tracing the bug)
THank you Can you try again with latest git ?
It manages to continue a little longer now (3420 log lines vs 3323 in the previous one), but it still gets killed in the same way. Should I upload the new log?
Can you kindly regenerate the log with the very latest git ?
The new debug info led me to try and raise XAPIAN_MIN_RAM.
When I set XAPIAN_MIN_RAM to 250L, it manages to keep the free mem around 100MB and the process completes normally:
doveadm(x.x@xxx.com): Warning: FTS Xapian: Free memory 119 MB vs 250 MB minimum
doveadm(x.x@xxx.com): Warning: FTS Xapian: Expunging with low memory (119 MB)-> Commiting on disk
doveadm(x.x@xxx.com): Info: FTS Xapian: Expunging (3a) UID=5363 (Free mem= 119 MB) '/var/vmail/xxx.com/x.x//Maildir/xapian-indexes/db_200d370a3add5d618e180000f0f6226a'
doveadm(x.x@xxx.com): Info: FTS Xapian: Expunging (3b) UID=5363 (Free mem= 119 MB) done
doveadm(x.x@xxx.com): Info: FTS Xapian: Expunging (5) '/var/vmail/xxx.com/x.x//Maildir/xapian-indexes/db_200d370a3add5d618e180000f0f6226a' done in 23.45 secs
doveadm(x.x@xxx.com): Info: FTS Xapian: Deinit /var/vmail/wanwire.com/x.x//Maildir/xapian-indexes)
doveadm(xx@xxx.com): Info: fts_backend_xapian_init : xapian
doveadm(xx@xxx.com): Info: FTS Xapian: Index path = /var/vmail/xxx.com/x//Maildir/xapian-indexes
doveadm(xx@xxx.com): Info: FTS Xapian: Starting with partial=2 full=20 verbose=2
doveadm(xx@xxx.com): Info: FTS Xapian: fts_backend_xapian_optimize '/var/vmail/xxx.com/x//Maildir/xapian-indexes'
doveadm(xx@xxx.com): Info: FTS Xapian: Deinit /var/vmail/xxx.com/x//Maildir/xapian-indexes)
Perhaps XAPIAN_MIN_RAM can be made configurable?
Hi I added a "lowmemory" paramater (check latest git README,md)
Today's git seems to cause a lot of leaked events:
doveadm: Warning: Event 0x5563f3f2b740 leaked (parent=0x5563f3f2b330): mail-user.c:78
doveadm: Warning: Event 0x5563f3f2b330 leaked (parent=(nil)): mail-storage-service.c:1359
doveadm: Warning: Event 0x5563f4009ef0 leaked (parent=0x5563f3f4cf80): mail-index.c:67
doveadm: Warning: Event 0x5563f40096c0 leaked (parent=0x5563f3f4cf80): fs-api.c:32
doveadm: Warning: Event 0x5563f40092b0 leaked (parent=0x5563f3f4cf80): mail-storage.c:430
doveadm: Warning: Event 0x5563f3f4cf80 leaked (parent=0x5563f3f21f00): mail-user.c:78
doveadm: Warning: Event 0x5563f3f21f00 leaked (parent=(nil)): mail-storage-service.c:1359
doveadm: Warning: Event 0x5563f3f2d080 leaked (parent=0x5563f3f234f0): mail-index.c:67
doveadm: Warning: Event 0x5563f3f2c820 leaked (parent=0x5563f3f234f0): fs-api.c:32
doveadm: Warning: Event 0x5563f3f2c300 leaked (parent=0x5563f3f234f0): mail-storage.c:430
doveadm: Warning: Event 0x5563f3f234f0 leaked (parent=0x5563f3f4e1d0): mail-user.c:78
doveadm: Warning: Event 0x5563f3f4e1d0 leaked (parent=(nil)): mail-storage-service.c:1359
doveadm: Warning: Event 0x5563f3f24d20 leaked (parent=0x5563f3fd58b0): mail-index.c:67
doveadm: Warning: Event 0x5563f3f24620 leaked (parent=0x5563f3fd58b0): fs-api.c:32
doveadm: Warning: Event 0x5563f3f23e30 leaked (parent=0x5563f3fd58b0): mail-storage.c:430
doveadm: Warning: Event 0x5563f3fd58b0 leaked (parent=0x5563f3fd54a0): mail-user.c:78
doveadm: Warning: Event 0x5563f3fd54a0 leaked (parent=(nil)): mail-storage-service.c:1359
doveadm: Warning: Event 0x5563f3fd6df0 leaked (parent=0x5563f3fcc8a0): mail-index.c:67
doveadm: Warning: Event 0x5563f3fd65c0 leaked (parent=0x5563f3fcc8a0): fs-api.c:32
doveadm: Warning: Event 0x5563f3fd5dd0 leaked (parent=0x5563f3fcc8a0): mail-storage.c:430
doveadm: Warning: Event 0x5563f3fcc8a0 leaked (parent=0x5563f3f1c990): mail-user.c:78
doveadm: Warning: Event 0x5563f3f1c990 leaked (parent=(nil)): mail-storage-service.c:1359
doveadm: Warning: Event 0x5563f3f16a20 leaked (parent=0x5563f3fbb710): mail-index.c:67
doveadm: Warning: Event 0x5563f3f16210 leaked (parent=0x5563f3fbb710): fs-api.c:32
doveadm: Warning: Event 0x5563f3f15a20 leaked (parent=0x5563f3fbb710): mail-storage.c:430
doveadm: Warning: Event 0x5563f3fbb710 leaked (parent=0x5563f3fbbf20): mail-user.c:78
doveadm: Warning: Event 0x5563f3fbbf20 leaked (parent=(nil)): mail-storage-service.c:1359
doveadm: Warning: Event 0x5563f3f11dd0 leaked (parent=0x5563f3f048f0): mail-index.c:67
doveadm: Warning: Event 0x5563f3f114b0 leaked (parent=0x5563f3f048f0): fs-api.c:32
doveadm: Warning: Event 0x5563f3f10e10 leaked (parent=0x5563f3f048f0): mail-storage.c:430
doveadm: Warning: Event 0x5563f3f048f0 leaked (parent=0x5563f3f05cb0): mail-user.c:78
doveadm: Warning: Event 0x5563f3f05cb0 leaked (parent=(nil)): mail-storage-service.c:1359
Edit: I see you are already working on this in #99.
yes, this latest "mirnor" version of dovecot introduced major changes without notice
@cmouse Can you help ?
@nielspeen Besides those memory leaks from dovecot, is the initial issue resolved ?
Dovecot api has not changed drastically. Using fts_mail_user_init/deinit has been there before, you just have gotten away omitting it so far. Those leaks go away once you use it correctly. You could look from fts_solr for example.
@cmouse I added the code from Solr already, and this is when the leaks appears
What are those functions about ? and how to fix those leaks ?
Thank you
it does not do same things
I already copied paste the code basically. What is wrong in my code ? what is the actual purpose of these functions ?
They initialize fts plugin. You are not calling the next function in chain, and you are not adding module context.
Can you please be much more clear ? What is "module context" , what "function in chain" are you referring to ?
All these were not needed before , and it worked pretty welll.
@nielspeen Is this now solved ?
This is now solved. Thanks!
The server has 6GB RAM of which approx 0.5GB is used by other processes.
fts-xapian is version 1.4.13.
Mailbox size is 2.2G.
Config:
When running /usr/bin/doveadm -v fts optimize -A memory goes up quickly during the expunging process. Eventually output stops. (Always at the same UID=10165.)
While the output is stopped, dovadm is still running and memory usage continues to grow. Eventually the OOM-killer kicks in and kills doveadm.
What can I do to reduce the memory usage? I've tried lowering the vsz_limit for the indexer-worker, but it seems to be ignored.