Bug 28464 - Cyrus DB_CONFIG per UCR
Cyrus DB_CONFIG per UCR
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Mail
UCS 3.0
Other Linux
: P5 enhancement (vote)
: UCS 3.2
Assigned To: Felix Botner
Sönke Schwardt-Krummrich
: interim-1
Depends on:
Blocks: 32354
  Show dependency treegraph
 
Reported: 2012-09-11 12:13 CEST by Janis Meybohm
Modified: 2013-11-19 06:43 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Meybohm univentionstaff 2012-09-11 12:13:51 CEST
2012091121000928, 2011050910005118

Es sollte eine Möglichkeit geben die BDB Konfiguration der Cyrus Datenbanken in UCR anzupassen:

# cat /var/lib/cyrus/db/DB_CONFIG 
set_cachesize 0 2097152 1
set_lg_regionmax 1048576

Dort werden momentan die Standardwerte verwendet welche ziemlich niedrig angesetzt sind:

# db4.7_stat -h /var/lib/cyrus/db -mgrep -i "cache size"
641KB 752B      Total cache size
648KB   Pool individual cache size

# db4.7_stat -h /var/lib/cyrus/db -l |grep "region size"
96KB    Log region size

Ggf. sollten wir die Werte auch standardmäßig etwas höher ansetzen, zumindest die kleine "log region size" hat bereits bei Kunden zu Problemen geführt:
--
DBERROR db4: Logging region out of memory; you may need to increase its size
DBERROR: opening /var/lib/cyrus/deliver.db: Cannot allocate memory
DBERROR: opening /var/lib/cyrus/deliver.db: cyrusdb error
FATAL: lmtpd: unable to init duplicate delivery database
--

<http://tagebuch.localwurst.de/2008/11/09/cyrus-dberror-db4-logging-region-out-of-memory/>
<http://www.cjc.org/blog/archives/2006/08/22/cyrus-imap-log-and-cache-settings/>
Comment 1 Janis Meybohm univentionstaff 2012-11-14 15:43:06 CET
Um die neuen Einstellungen zu übernehmen, muss ein db4.7_recover ausgeführt werden:
 - /etc/init.d/cyrus2.2 stop
 - db4.7_recover -h /var/lib/cyrus/db
 - /etc/init.d/cyrus2.2 start
Comment 2 Felix Botner univentionstaff 2013-06-19 12:18:07 CEST
Ich habe nun ein Template für /var/lib/cyrus/db/DB_CONFIG  in univention-mail-cyrus hinzugefügt. Diese Template ist auf alle Variablen mit dem Prefix "mail/cyrus/bdb/dbconfig/" registriert und schreibt die Variablen ohne Prefix und den Wert in die DB_CONFIG.

Standardwerte sind 
    mail/cyrus/bdb/dbconfig/set_cachesize?"0 2097152 1"
    mail/cyrus/bdb/dbconfig/set_lg_regionmax?"2097152"

Ein "db4.X_recover" ist nicht notwendig, es reicht ein Neustart des cyrus, siehe

-> db4.X_stat -m -h /var/lib/cyrus/db
-> db4.X_stat -l -h /var/lib/cyrus/db

Es gibt einen Hinweis in den Release Notes, dass eine eventuell vorhanden DB_CONFIG beim Update auf DB_CONFIG.debian kopiert wird und dass man Variablen auch vor dem Update setzen kann, damit die neue Config dann entsprechend aussieht.

QA:

Update mit cyrus 2.2
Update mit cyrus 2.4
Installation mit cyrus 2.2
Installation mit cyrus 2.4
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2013-08-20 12:45:21 CEST
OK: existing DB_CONFIG file will be renamed to DB_CONFIG.debian (only once)
OK: all UCR variables are written without prefix into DB_CONFIG
OK: db4.X_recover is not required; a cyrus restart is sufficient; all values that 
    have been set, take effect after restart of cyrus - checked via db4.X_stat 
    (see comment above)
OK: changelog / release notes (small fixes have been comitted)
OK: installation of Cyrus 2.2 on UCS 3.2
OK: installation of Cyrus 2.4 on UCS 3.2
OK: update of Cyrus 2.2 from 3.1-1 to 3.2
OK: update of Cyrus 2.4 from 3.1-1 to 3.2

A typo within the UCR variable descriptions has been fixed and the package has been rebuilt:
sed -i -e 's/DBD/BDB/' \
              debian/univention-mail-cyrus.univention-config-registry-variables

univention-mail-cyrus (6.0.4-3) unstable; urgency=low
Comment 4 Stefan Gohmann univentionstaff 2013-11-19 06:43:12 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".