Quoting Julien Coloos <julien.col...@gmail.com>:

Hi,

In latest cyrus versions (beginning with 2.3.x branch), cyrus is
capable of selecting the most fitting partition when creating a new
account. To do so, the default partition has to be left unspecified,
and in this case cyrus selects the partition with the most free space.
Similarly, when creating an account from a murder proxy, it is
possible to let cyrus select the backend with the most free space.

Due to some of our clients needs, we had to rework those features to
handle other modes of selection (see below). We currently have code
for 2.3.16 version.
If you are interested, we could create a patch out of it, adapted for
2.4.5 version, and add an entry for it on bugzilla.


Here are some details on the changes we made:

Partitions/backend are managed using a new structure which contains
all valuable data. Those data are retrieved the first time it is
needed, and then cached (configuration allows to refresh data).

New configuration options manage partition/backend selection:
   - partition_mode: how most fitting partition is selected; value is one of
      - random: (pseudo-)random selection
      - freespace-most: partition with the most free space (KiB)
         -> same as current cyrus behaviour
      - freespace-percent-most: partition with the most free space (%)
      - freespace-percent-weighted: each partition is weighted
according to its free space (%)
         -> the more free space the partition has, the more chances it
has to be selected
      - freespace-percent-weighted-delta: each partition is weighted
according to its difference of free space (%) compared to the most
used partition
         -> the more the partition is lagging behind the most used
partition, the more chances it has to be selected
         -> actually the code is made so that even the most used
partition has a few chances to be selected, and those chances increase
when other partitions get closer
- partition_mode_exclude: list of partitions to exclude from selection mode
   - partition_mode_weighted_usage_limit: limit of partition usage (%)
      -> if a partition is over that limit, it is automatically
excluded from selection mode
-> if all partitions are over that limit, this feature is not used anymore
   - partition_mode_usage_reinit: for a given session, number of
"operations" (e.g. partition selection) for which partitions usage
data are cached
      -> useful for clients that massively create new mailboxes using
the same session

   - serverlist_mode: same as partition_mode, but used on proxy for
selecting most fitting backend
      - random: (pseudo-)random
      - freespace-most: backend with the most (total) free space (KiB)
         -> same as current cyrus behaviour
      - freespace-percent-most: backend whose partition has the most
free space (%)
         -> and not the backend with the most (total) free space (%);
the goal is to compare the most fitting partition of each backend
      - freespace-percent-weighted: same as for partition selection,
comparing the free space (%) of the least used partition of each
backend
         -> again the goal is to compare the most fitting partition of
each backend
      - freespace-percent-weighted-delta: same as for partition
selection, comparing the free space (%) of the least used partition of
each backend
         -> again the goal is to compare the most fitting partition of
each backend
   - serverlist_mode_weighted_usage_limit: same as
partition_mode_weighted_usage_limit
   - serverlist_mode_usage_reinit: same as partition_mode_usage_reinit

I would like to see this included in the official cyrus.

It would be nice if the space reserved by quota could be
taken into account.


--------------------------------------------------------------------------------
M.Menge                                Tel.: (49) 7071/29-70316
Universität Tübingen                   Fax.: (49) 7071/29-5912
Zentrum für Datenverarbeitung mail: michael.me...@zdv.uni-tuebingen.de
Wächterstraße 76
72074 Tübingen

Attachment: smime.p7s
Description: S/MIME Signatur

Reply via email to