1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473
|
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mailbox Creation Distribution — Cyrus IMAP 3.10.2 documentation</title>
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/cyrus.css" type="text/css" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/sphinx_highlight.js"></script>
<script src="../../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Known Protocol Limitations" href="known_protocol_limitations.html" />
<link rel="prev" title="Databases" href="databases.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home">
Cyrus IMAP
</a>
<div class="version">
3.10.2
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Cyrus IMAP</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../download.html">Download</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../quickstart.html">Quickstart Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../overview.html">Overview</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../../setup.html">Setup</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../developer/compiling.html">Compiling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../installing.html">Installing Cyrus</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../download/upgrade.html">Upgrading to 3.10</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../deployment.html">Configuration Guide</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="deployment_scenarios.html">Deployment Scenarios</a></li>
<li class="toctree-l3"><a class="reference internal" href="deployment_scenarios.html#cyrus-murder-server-aggregation">Cyrus Murder: Server aggregation</a></li>
<li class="toctree-l3"><a class="reference internal" href="deployment_scenarios.html#cyrus-replication">Cyrus Replication</a></li>
<li class="toctree-l3"><a class="reference internal" href="deployment_scenarios.html#hosted-environments">Hosted Environments</a></li>
<li class="toctree-l3"><a class="reference internal" href="databases.html">Databases</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Mailbox Creation Distribution</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#selection-mode">Selection Mode</a></li>
<li class="toctree-l4"><a class="reference internal" href="#special-cases">Special cases</a></li>
<li class="toctree-l4"><a class="reference internal" href="#partitions-exclusion">Partitions Exclusion</a></li>
<li class="toctree-l4"><a class="reference internal" href="#partitions-usage-data-reset">Partitions Usage Data Reset</a></li>
<li class="toctree-l4"><a class="reference internal" href="#mailbox-creation-distribution-through-murder-frontend">Mailbox Creation Distribution Through <code class="docutils literal notranslate"><span class="pre">murder</span> <span class="pre">frontend</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#backends-exclusion">Backends Exclusion</a></li>
<li class="toctree-l4"><a class="reference internal" href="#backends-usage-data-reset">Backends Usage Data Reset</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="known_protocol_limitations.html">Known Protocol Limitations</a></li>
<li class="toctree-l3"><a class="reference internal" href="authentication_and_authorization.html">Authentication and Authorization</a></li>
<li class="toctree-l3"><a class="reference internal" href="performance_recommendations.html">Performance Recommendations</a></li>
<li class="toctree-l3"><a class="reference internal" href="storage.html">Storage Considerations</a></li>
<li class="toctree-l3"><a class="reference internal" href="supported-platforms.html">Supported Platforms and System Requirements</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../operations.html">Operations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developers.html">Developers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../support.html">Support/Community</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Cyrus SASL</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="http://www.cyrusimap.org/sasl">Cyrus SASL</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">Cyrus IMAP</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../../../setup.html">Setup</a></li>
<li class="breadcrumb-item"><a href="../deployment.html">Configuration Guide</a></li>
<li class="breadcrumb-item active">Mailbox Creation Distribution</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/cyrusimap/cyrus-imapd/blob/master/docsrc/imap/concepts/deployment/mailbox_creation_distribution.rst" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="mailbox-creation-distribution">
<h1>Mailbox Creation Distribution<a class="headerlink" href="#mailbox-creation-distribution" title="Permalink to this heading"></a></h1>
<p>By default, when creating a mailbox in Cyrus IMAP:</p>
<ul class="simple">
<li><p>the backend with the most free disk space is selected on the Murder frontend</p></li>
<li><p>the partition with the most free disk space is selected on the backend</p></li>
</ul>
<p>This may not be the most appropriate backend or partition to create the new mailbox on, and Cyrus IMAP therefor allows for a variety of additional modes of calculating and selecting the most appropriate backend and partition. The exact mode for the selection is controlled with the <code class="docutils literal notranslate"><span class="pre">imapd.conf</span></code> setting <code class="docutils literal notranslate"><span class="pre">serverlist_select_mode</span></code> on the frontend and <code class="docutils literal notranslate"><span class="pre">partition_select_mode</span></code> on the backend.</p>
<p>Alternatively, a default backend can be configured with the <code class="docutils literal notranslate"><span class="pre">defaultserver</span></code> setting on a frontend, and a default partition can be configured with the <code class="docutils literal notranslate"><span class="pre">defaultpartition</span></code> on a backend.</p>
<p>Prior to Cyrus IMAP version 2.5, when creating a mailbox, should no
target partition have been specified, the mailbox is either created on:</p>
<ul class="simple">
<li><p>the configured <code class="docutils literal notranslate"><span class="pre">defaultserver</span></code>, or</p></li>
<li><p>the server that is found to have the most free disk space, and</p></li>
<li><p>the configured <code class="docutils literal notranslate"><span class="pre">defaultpartition</span></code>, or</p></li>
<li><p>the most fitting partition if <code class="docutils literal notranslate"><span class="pre">defaultpartition</span></code> is not
configured.</p></li>
</ul>
<p>New configuration options are available since Cyrus IMAP 2.5, that
allow more weighted and better balanced backend and partition
selection.</p>
<section id="selection-mode">
<h2>Selection Mode<a class="headerlink" href="#selection-mode" title="Permalink to this heading"></a></h2>
<p>Among the partitions, how the most fitting one is selected depends on the configured selection mode: <code class="docutils literal notranslate"><span class="pre">partition_mode</span></code> setting in <code class="docutils literal notranslate"><span class="pre">/etc/imapd.conf</span></code></p>
<section id="available-selection-modes">
<h3>Available Selection Modes<a class="headerlink" href="#available-selection-modes" title="Permalink to this heading"></a></h3>
<ul>
<li><p>random</p>
<blockquote>
<div><p>Choice is (pseudo-)random. Each partition has the same probability of being selected.</p>
</div></blockquote>
</li>
<li><p>freespace-most</p>
<blockquote>
<div><p>The partition which has the most free space (counted in KiB units) is selected.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Example of <code class="docutils literal notranslate"><span class="pre">freespace-most</span></code> selection on backend</p>
<p>Suppose that the configured partitions are:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">part1</span></code> which has a 1000GiB capacity, 400GiB being free (that is, 40% free space)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">part2</span></code> which has a 1000GiB capacity, 600GiB being free (that is, 60% free space)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">part3</span></code> which has a 100GiB capacity, 30GiB being free (that is, 30% free space)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">part4</span></code> which has a 100GiB capacity, 70GiB being free (that is, 70% free space)</p></li>
</ul>
<p>In that case <code class="docutils literal notranslate"><span class="pre">part2</span></code> will be selected as most fitting, since 600GiB of free space is the biggest of all partitions.</p>
</div>
</div></blockquote>
</li>
<li><p>freespace-percent-most</p>
<blockquote>
<div><p>The partition which has the most percentage of free space is selected.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Example of <code class="docutils literal notranslate"><span class="pre">freespace-percent-most</span></code> selection on backend</p>
<p>In the same conditions, <code class="docutils literal notranslate"><span class="pre">part4</span></code> would be selected as most fitting, since 70% of free space is the biggest of all partitions.</p>
</div>
</div></blockquote>
</li>
<li><p>freespace-percent-weighted</p>
<blockquote>
<div><p>For each partition, the percentage of free space is its weight. Then a weighted choice is performed to select one of those partitions.</p>
<p>As such, the more free space the partition has, the more chances it has to be selected.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Example of <code class="docutils literal notranslate"><span class="pre">freespace-percent-weighted</span></code> selection on backend</p>
<p>In the same conditions, the weight of each partition would be:</p>
<ul class="simple">
<li><p>40 for <code class="docutils literal notranslate"><span class="pre">part1</span></code></p></li>
<li><p>60 for <code class="docutils literal notranslate"><span class="pre">part2</span></code></p></li>
<li><p>30 for <code class="docutils literal notranslate"><span class="pre">part3</span></code></p></li>
<li><p>70 for <code class="docutils literal notranslate"><span class="pre">part4</span></code></p></li>
</ul>
<p>The sum of each weight being 200, the probability for each partition to be selected as most fitting would be:</p>
<ul class="simple">
<li><p>20% for <code class="docutils literal notranslate"><span class="pre">part1</span></code></p></li>
<li><p>30% for <code class="docutils literal notranslate"><span class="pre">part2</span></code></p></li>
<li><p>15% for <code class="docutils literal notranslate"><span class="pre">part3</span></code></p></li>
<li><p>35% for <code class="docutils literal notranslate"><span class="pre">part4</span></code></p></li>
</ul>
</div>
</div></blockquote>
</li>
</ul>
</section>
<section id="usage-convergence">
<h3>Usage convergence<a class="headerlink" href="#usage-convergence" title="Permalink to this heading"></a></h3>
<p>In <code class="docutils literal notranslate"><span class="pre">freespace-percent-weighted</span></code> mode, partitions percentage usages converge towards 100%. So if they have different usages, those differences will stay and only really diminish upon reaching 100% of usage.</p>
<p>You may also observe growing differences between partitions usage when those partitions do not have the same total disk space.</p>
<ul class="simple">
<li><p>freespace-percent-weighted-delta</p></li>
</ul>
<p>As for <code class="docutils literal notranslate"><span class="pre">freespace-percent-weighted</span></code>, a weight is associated to each partition. It is computed as follows: (<em>percentage of freespace of partition</em>) - (<em>lowest percentage of freespace of all partitions</em>) + 0.5</p>
<p>Then a weighted choice is performed to select one of those partitions.</p>
<p>As such, considering the percentages of usage, the more the partition is lagging behind the most used partition (which is the one with the lowest percentage of free space), the more chances it has to be selected.</p>
</section>
<section id="computed-weight">
<h3>Computed weight<a class="headerlink" href="#computed-weight" title="Permalink to this heading"></a></h3>
<p>The added 0.5 in partitions weight is so that selection gets smoother when all partitions get close to each other.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><strong>Example of ``freespace-percent-weighted-delta`` Selection on Backend</strong></p>
<p>In the same conditions, the weight of each partition would be:</p>
<ul class="simple">
<li><p>40 - 30 + 0.5 = 10.5 for <code class="docutils literal notranslate"><span class="pre">part1</span></code></p></li>
<li><p>60 - 30 + 0.5 = 30.5 for <code class="docutils literal notranslate"><span class="pre">part2</span></code></p></li>
<li><p>30 - 30 + 0.5 = 0.5 for <code class="docutils literal notranslate"><span class="pre">part3</span></code></p></li>
<li><p>70 - 30 + 0.5 = 40.5 for <code class="docutils literal notranslate"><span class="pre">part4</span></code></p></li>
</ul>
<p>Then the probability for each partition to be selected as most fitting would be:</p>
<ul class="simple">
<li><p>12.8% for <code class="docutils literal notranslate"><span class="pre">part1</span></code></p></li>
<li><p>37.2% for <code class="docutils literal notranslate"><span class="pre">part2</span></code></p></li>
<li><p>0.6% for <code class="docutils literal notranslate"><span class="pre">part3</span></code></p></li>
<li><p>49.4% for <code class="docutils literal notranslate"><span class="pre">part4</span></code></p></li>
</ul>
<p><strong>Usage convergence</strong></p>
<p>In <code class="docutils literal notranslate"><span class="pre">freespace-percent-weighted-delta</span></code> mode, partitions percentage usages converge towards the most used one. And then partitions usages grow equally.</p>
</div>
</section>
</section>
<section id="special-cases">
<h2>Special cases<a class="headerlink" href="#special-cases" title="Permalink to this heading"></a></h2>
<section id="what-happens-when-two-partitions-are-equal-as-most-fitting">
<h3>What happens when two partitions are equal as most fitting?<a class="headerlink" href="#what-happens-when-two-partitions-are-equal-as-most-fitting" title="Permalink to this heading"></a></h3>
<p>Suppose you are using the <code class="docutils literal notranslate"><span class="pre">freespace-most</span></code> selection mode, that two (or more) partitions have the same free size, and that this freespace happens to be the biggest one of all configured partitions.</p>
<p>In that case, only one of those partitions will be selected. You may not know in advance which one will be: it depends of the order in which configured partitions are stored in memory (<code class="docutils literal notranslate"><span class="pre">hashtable</span></code>). In particular, it may not be the first one that appears listed in your <code class="docutils literal notranslate"><span class="pre">/etc/imapd.conf</span></code> configuration file.</p>
<p>Also note that since the selected partition will now have less free space, it shall not be seen as most fitting next time.</p>
</section>
<section id="what-happens-when-two-partitions-point-to-the-same-device">
<h3>What happens when two partitions point to the same device?<a class="headerlink" href="#what-happens-when-two-partitions-point-to-the-same-device" title="Permalink to this heading"></a></h3>
<p>Suppose you are using the <code class="docutils literal notranslate"><span class="pre">freespace-most</span></code> or <code class="docutils literal notranslate"><span class="pre">freespace-percent-most</span></code> selection mode, and that two (or more) partitions actually point to the same device (that is the device id is the same).</p>
<p>In that case, only one of those partitions will be checked, as if the others were not configured. You may not know in advance which one will be: it depends of the order in which configured partitions are stored in memory (<code class="docutils literal notranslate"><span class="pre">hashtable</span></code>). In particular, it may not be the first one that appears listed in your <code class="docutils literal notranslate"><span class="pre">/etc/imapd.conf</span></code> configuration file.</p>
</section>
</section>
<section id="partitions-exclusion">
<h2>Partitions Exclusion<a class="headerlink" href="#partitions-exclusion" title="Permalink to this heading"></a></h2>
<p>Partitions listed in the <code class="docutils literal notranslate"><span class="pre">partition_mode_exclude</span></code> setting are permanently excluded from being selected.</p>
<ul>
<li><p>partition_mode_exclude</p>
<blockquote>
<div><p>Listed partitions names are separated by space or comma. Only configured partition names (and not paths) are expected.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Example of permanent partition exclusion</p>
<p>With the following configuration in <cite>/etc/imapd.conf</cite>, <code class="docutils literal notranslate"><span class="pre">parta</span></code> and <code class="docutils literal notranslate"><span class="pre">partb</span></code> would be permanently excluded from being selected:</p>
<p>partition-part1: /path/to/part1
partition-part2: /path/to/part2
partition-part3: /path/to/part3
partition-part4: /path/to/part4
partition-parta: /path/to/parta
partition-partb: /path/to/partb</p>
<p>partition_mode_exclude: parta partb</p>
<p>When using a selection mode other than <code class="docutils literal notranslate"><span class="pre">random</span></code>, partitions are automatically excluded if their usage percentage is beyond the <code class="docutils literal notranslate"><span class="pre">partition_mode_soft_usage_limit</span></code> integer setting.</p>
</div>
</div></blockquote>
</li>
<li><p>partition_mode_soft_usage_limit</p>
<blockquote>
<div><p>If all partitions are beyond the configured value, this feature is automatically deactivated. A partition is thus selected as if the setting was not set.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Example of partition exclusion using <code class="docutils literal notranslate"><span class="pre">partition_mode_soft_usage_limit</span></code></p>
<p>In the same conditions than <xref linkend="exam-Deployment_Guide-Available_Selection_Modes_on_Backend-Example_of_freespace_most_Selection_on_Backend" />, setting <code class="docutils literal notranslate"><span class="pre">partition_mode_soft_usage_limit</span></code> to <code class="docutils literal notranslate"><span class="pre">50</span></code> would exclude partitions <code class="docutils literal notranslate"><span class="pre">part1</span></code> and <code class="docutils literal notranslate"><span class="pre">part3</span></code> since their disk usage is respectively 60% and 70%.</p>
<p>But setting the option to <code class="docutils literal notranslate"><span class="pre">20</span></code> would have no effect, since the usage of all partitions is beyond 20%.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p><strong>Exclusion is not absolute</strong></p>
<p>Partitions are only excluded when creating a new user mailbox according to the configured selection mode.</p>
<p>If you explicitly specify an excluded partition, the mailbox will be created on that partition.</p>
<p>Mailboxes previously created on such partitions are of course still accessible, and subfolders are by default still created on the same partition as the parent folder.</p>
</div>
</div></blockquote>
</li>
</ul>
</section>
<section id="partitions-usage-data-reset">
<h2>Partitions Usage Data Reset<a class="headerlink" href="#partitions-usage-data-reset" title="Permalink to this heading"></a></h2>
<p>By default partitions usage data are retrieved only once upon service initialization. This only concerns selection modes other than <code class="docutils literal notranslate"><span class="pre">random</span></code>.</p>
<p>If you tend to use the same service instance for a long lapse of time and performs a large amount of mailboxes creation, it may be useful to configure the <code class="docutils literal notranslate"><span class="pre">partition_mode_usage_reinit</span></code> so that partitions usage data are refreshed after the configured number of creation requests.</p>
</section>
<section id="mailbox-creation-distribution-through-murder-frontend">
<h2>Mailbox Creation Distribution Through <code class="docutils literal notranslate"><span class="pre">murder</span> <span class="pre">frontend</span></code><a class="headerlink" href="#mailbox-creation-distribution-through-murder-frontend" title="Permalink to this heading"></a></h2>
<p>Upon creating a user mailbox, if the target server is not given as extra parameter, the mailbox is either created on</p>
<ul class="simple">
<li><p>the configured <code class="docutils literal notranslate"><span class="pre">defaultserver</span></code> backend</p></li>
<li><p>the most fitting backend among the servers listed in the <code class="docutils literal notranslate"><span class="pre">serverlist</span></code> setting, if <code class="docutils literal notranslate"><span class="pre">defaultserver</span></code> is not configured</p></li>
</ul>
<section id="id2">
<h3>Selection Mode<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h3>
<p>Among the backends, how the most fitting one is selected depends on the configured selection mode: <code class="docutils literal notranslate"><span class="pre">serverlist_mode</span></code> setting in <code class="docutils literal notranslate"><span class="pre">/etc/imapd.conf</span></code>.</p>
<p>The principle is similar to the mailbox creation distribution on backend (see <xref linkend="sect-Deployment_Guide-Mailbox_Creation_Distribution-On_backend" />).</p>
</section>
<section id="available-selection-modes-on-frontend">
<h3>Available Selection Modes on Frontend<a class="headerlink" href="#available-selection-modes-on-frontend" title="Permalink to this heading"></a></h3>
<ul>
<li><p>random</p>
<blockquote>
<div><p>Choice is (pseudo-)random. Each backend has the same probability of being selected.</p>
</div></blockquote>
</li>
<li><p>freespace-most</p>
<blockquote>
<div><p>The backend which has the most free space (counted in KiB units) is selected. The considered free space is the sum of all available partitions free space on the backend.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Example of <code class="docutils literal notranslate"><span class="pre">freespace-most</span></code> Selection on Frontend</p>
<p>Suppose that the configured backends are:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">backend1</span></code> which has a 2000GiB capacity, 1000GiB being free (that is, 50% free space), composed of 2 partitions</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">part1</span></code> which has a 1000GiB capacity, 500GiB being free (that is, 50% free space)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">part2</span></code> which has a 1000GiB capacity, 500GiB being free (that is, 50% free space)</p>
<blockquote>
<div><ul>
<li><p><code class="docutils literal notranslate"><span class="pre">backend2</span></code> which has a 2000GiB capacity, 900GiB being free (that is, 45% free space), composed of 2 partitions</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">part1</span></code> which has a 1000GiB capacity, 200GiB being free (that is, 20% free space)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">part2</span></code> which has a 1000GiB capacity, 700GiB being free (that is, 70% free space)</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">backend3</span></code> which has a 200GiB capacity, 110GiB being free (that is, 55% free space), composed of 2 partitions</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">part1</span></code> which has a 100GiB capacity, 30GiB being free (that is, 30% free space)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">part2</span></code> which has a 100GiB capacity, 80GiB being free (that is, 80% free space)</p></li>
</ul>
</div></blockquote>
</li>
</ul>
</div></blockquote>
</li>
<li><p>In that case <code class="docutils literal notranslate"><span class="pre">backend1</span></code> will be selected as most fitting, since 1000GiB of free space is the biggest of all backends.</p></li>
</ul>
</div>
</div></blockquote>
</li>
<li><p>freespace-percent-most</p>
<blockquote>
<div><p>On each backend, the partition with the most percentage of free space is considered. The selected backend is the one whose partition has the most percentage of free space.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Example of <code class="docutils literal notranslate"><span class="pre">freespace-percent-most</span></code> Selection on Frontend</p>
<p>In the same conditions than <xref linkend="exam-Deployment_Guide-Available_Selection_Modes_on_Frontend-Example_of_freespace_most_Selection_on_Frontend" /> <code class="docutils literal notranslate"><span class="pre">backend3</span></code> would be selected as most fitting, since it has a partition with 80% of free space which is the biggest of all backends.</p>
</div>
</div></blockquote>
</li>
<li><p>freespace-percent-weighted</p>
<blockquote>
<div><p>On each backend, the partition with the most percentage of free space is considered: it is the backend weight. Then a weighted choice is performed to select one of the backends.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Example of <code class="docutils literal notranslate"><span class="pre">freespace-percent-weighted</span></code> Selection on Frontend</p>
<p>In the same conditions than <xref linkend="exam-Deployment_Guide-Available_Selection_Modes_on_Frontend-Example_of_freespace_most_Selection_on_Frontend" />, the weight of each backend would be:</p>
<blockquote>
<div><ul class="simple">
<li><p>50 for <code class="docutils literal notranslate"><span class="pre">backend1</span></code></p></li>
<li><p>70 for <code class="docutils literal notranslate"><span class="pre">backend2</span></code></p></li>
<li><p>80 for <code class="docutils literal notranslate"><span class="pre">backend3</span></code></p></li>
</ul>
</div></blockquote>
<p>The sum of each weight being 200, the probability for each backend to be selected as most fitting would be:</p>
<blockquote>
<div><ul class="simple">
<li><p>25% for <code class="docutils literal notranslate"><span class="pre">backend1</span></code></p></li>
<li><p>35% for <code class="docutils literal notranslate"><span class="pre">backend2</span></code></p></li>
<li><p>40% for <code class="docutils literal notranslate"><span class="pre">backend3</span></code></p></li>
</ul>
</div></blockquote>
</div>
</div></blockquote>
</li>
<li><p>freespace-percent-weighted-delta</p></li>
</ul>
<p>On each backend, the partition with the most percentage of free space is considered. As for <code class="docutils literal notranslate"><span class="pre">freespace-percent-weighted</span></code>, a weight is associated to each backend. It is computed as follows: (<em>percentage of freespace on backend</em>) - (<em>lowest percentage of freespace of all backends</em>) + 0.5</p>
<p>Then a weighted choice is performed to select one of the backends.</p>
<blockquote>
<div><div class="admonition note">
<p class="admonition-title">Note</p>
<p><strong>Example of ``freespace-percent-weighted-delta`` Selection on Frontend</strong></p>
<p>In the same conditions than <xref linkend="exam-Deployment_Guide-Available_Selection_Modes_on_Frontend-Example_of_freespace_most_Selection_on_Frontend" />, the weight of each backend would be:</p>
<ul class="simple">
<li><p>50 - 50 + 0.5 = 0.5 for <code class="docutils literal notranslate"><span class="pre">backend1</span></code></p></li>
<li><p>70 - 50 + 0.5 = 20.5 for <code class="docutils literal notranslate"><span class="pre">backend2</span></code></p></li>
<li><p>80 - 50 + 0.5 = 30.5 for <code class="docutils literal notranslate"><span class="pre">backend3</span></code></p></li>
</ul>
<p>Then the probability for each backend to be selected as most fitting would be:</p>
<ul class="simple">
<li><p>1.0% for <code class="docutils literal notranslate"><span class="pre">backend1</span></code></p></li>
<li><p>39.8% for <code class="docutils literal notranslate"><span class="pre">backend2</span></code></p></li>
<li><p>59.2% for <code class="docutils literal notranslate"><span class="pre">backend3</span></code></p></li>
</ul>
</div>
</div></blockquote>
</section>
</section>
<section id="backends-exclusion">
<h2>Backends Exclusion<a class="headerlink" href="#backends-exclusion" title="Permalink to this heading"></a></h2>
<p>When using a selection mode other than <code class="docutils literal notranslate"><span class="pre">random</span></code>, backends are automatically excluded if their considered usage percentage is beyond the <code class="docutils literal notranslate"><span class="pre">serverlist_mode_soft_usage_limit</span></code> integer setting.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">partition_mode_soft_usage_limit</span></code></p></li>
</ul>
<p>If all backends are beyond the configured value, this feature is automatically deactivated. A backend is thus selected as if the setting was not set.</p>
<blockquote>
<div><div class="admonition note">
<p class="admonition-title">Note</p>
<p>Example of partition exclusion using <code class="docutils literal notranslate"><span class="pre">serverlist_mode_soft_usage_limit</span></code></p>
<p>In the same conditions than <xref linkend="exam-Deployment_Guide-Available_Selection_Modes_on_Frontend-Example_of_freespace_most_Selection_on_Frontend" />, using <code class="docutils literal notranslate"><span class="pre">freespace-most</span></code> selection mode, setting <code class="docutils literal notranslate"><span class="pre">serverlist_mode_soft_usage_limit</span></code> to <code class="docutils literal notranslate"><span class="pre">49</span></code> would exclude <code class="docutils literal notranslate"><span class="pre">backend1</span></code> and <code class="docutils literal notranslate"><span class="pre">backend2</span></code> since in that mode they have a disk usage of 50% and 55%. In other modes it would however only exclude <code class="docutils literal notranslate"><span class="pre">backend1</span></code> whose considered partition has a disk usage of 50%, while on <code class="docutils literal notranslate"><span class="pre">backend2</span></code> the considered partition has a disk usage of 30%.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p><strong>Exclusion is not absolute</strong></p>
<p>Backends are only excluded when creating a new user mailbox according to the configured selection mode.</p>
<p>If you explicitly specify an excluded backend, the mailbox will be created on that backend.</p>
<p>Mailboxes previously created on such backends are of course still accessible.</p>
</div>
</div></blockquote>
</section>
<section id="backends-usage-data-reset">
<h2>Backends Usage Data Reset<a class="headerlink" href="#backends-usage-data-reset" title="Permalink to this heading"></a></h2>
<p>By default backends usage data are retrieved only once upon service initialization. This only concerns selection modes other than <code class="docutils literal notranslate"><span class="pre">random</span></code>.</p>
<p>If you tend to use the same service instance for a long lapse of time and performs a large amount of mailboxes creation, it may be useful to configure the <code class="docutils literal notranslate"><span class="pre">serverlist_mode_usage_reinit</span></code> so that backends usage data are refreshed after the configured number of creation requests.</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="databases.html" class="btn btn-neutral float-left" title="Databases" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="known_protocol_limitations.html" class="btn btn-neutral float-right" title="Known Protocol Limitations" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 1993–2025, The Cyrus Team.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
|