<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Server-side Caching — Bcfg2 1.3.0 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '1.3.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/sidebar.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="top" title="Bcfg2 1.3.0 documentation" href="../index.html" /> <link rel="up" title="The Bcfg2 Server" href="index.html" /> <link rel="next" title="Bcfg2 Data Encryption" href="encryption.html" /> <link rel="prev" title="Global Database Settings" href="database.html" /> <link rel="stylesheet" href="../_static/bcfg2.css" type=""/> </head> <body> <div style="text-align: left; padding: 10px 10px 15px 15px"> <a href="../index.html"><img src="../_static/bcfg2_logo.png" border="0" alt="sampledoc"/></a> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="encryption.html" title="Bcfg2 Data Encryption" accesskey="N">next</a> |</li> <li class="right" > <a href="database.html" title="Global Database Settings" accesskey="P">previous</a> |</li> <li><a href="../index.html">home</a> | </li> <!--<li><a href="../search.html">search</a> | </li>--> <li><a href="../help/index.html">help</a> | </li> <li><a href="../contents.html">documentation </a> »</li> <li><a href="../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="index.html" accesskey="U">The Bcfg2 Server</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="server-side-caching"> <span id="server-caching"></span><h1>Server-side Caching<a class="headerlink" href="#server-side-caching" title="Permalink to this headline">¶</a></h1> <div class="section" id="metadata-caching"> <h2>Metadata Caching<a class="headerlink" href="#metadata-caching" title="Permalink to this headline">¶</a></h2> <p class="versionadded"> <span class="versionmodified">New in version 1.3.0.</span></p> <p>Caching (or, rather, cache expiration) is always a difficult problem, but it’s particularly vexing in Bcfg2 due to the number of different data sources incorporated. In 1.3.0, we introduce some limited caching of client metadata objects. Since a client metadata object can be generated anywhere from 7 to dozens of times per client run (depending on your templates), and since client metadata generation was made more complex and powerful in 1.3.0, caching these objects provides the easiest performance gain.</p> <p>To enable caching, add a <tt class="docutils literal"><span class="pre">[caching]</span></tt> section to bcfg2.conf with a client_metadata option containing one of the following modes:</p> <ul class="simple"> <li><tt class="docutils literal"><span class="pre">off</span></tt>: No caching of client metadata objects is performed. This is the default.</li> <li><tt class="docutils literal"><span class="pre">initial</span></tt>: Only initial metadata objects are cached. Initial metadata objects are created only from the data in the <a class="reference internal" href="plugins/grouping/metadata.html#server-plugins-grouping-metadata"><em>Metadata</em></a> plugin, before additional groups from other plugins are merged in.</li> <li><tt class="docutils literal"><span class="pre">cautious</span></tt>: Final metadata objects are cached, but each client’s cache is cleared at the start of each client run, immediately after probe data is received. Cache is also cleared as in <tt class="docutils literal"><span class="pre">aggressive</span></tt> mode. <tt class="docutils literal"><span class="pre">on</span></tt> is a synonym for <tt class="docutils literal"><span class="pre">cautious</span></tt>.</li> <li><tt class="docutils literal"><span class="pre">aggressive</span></tt>: Final metadata objects are cached. Each plugin is responsible for clearing cache when appropriate.</li> </ul> <p>These are presented roughly in ascending order of speed, and descending order of reliability. That is, odds are higher that <tt class="docutils literal"><span class="pre">aggressive</span></tt> mode will result in stale data, but it gives the biggest speed boost. <tt class="docutils literal"><span class="pre">off</span></tt> will never result in stale data, but it gives no speed boost.</p> <p>In addition to the <a class="reference internal" href="plugins/grouping/metadata.html#server-plugins-grouping-metadata"><em>Metadata</em></a> plugin, Bcfg2 includes three plugins that can set additional groups, and thus may affect the caching behavior. They are <a class="reference internal" href="plugins/grouping/grouppatterns.html#server-plugins-grouping-grouppatterns"><em>GroupPatterns</em></a>, <a class="reference internal" href="plugins/probes/index.html#server-plugins-probes-index"><em>Probes</em></a>, and <a class="reference internal" href="plugins/connectors/puppetenc.html#server-plugins-connectors-puppetenc"><em>PuppetENC</em></a>. All of those plugins <strong>except</strong> for PuppetENC fully support all caching levels. PuppetENC is incompatible with <tt class="docutils literal"><span class="pre">aggressive</span></tt>, and may result in some stale data with <tt class="docutils literal"><span class="pre">cautious</span></tt>.</p> <p>If you are not using the PuppetENC plugin, and do not have any custom plugins that provide additional groups, then all four modes should be safe to use. If you are using PuppetENC or have custom Connector plugins that provide additional groups, then you may want to start with <tt class="docutils literal"><span class="pre">cautious</span></tt> or <tt class="docutils literal"><span class="pre">initial</span></tt>.</p> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Server-side Caching</a><ul> <li><a class="reference internal" href="#metadata-caching">Metadata Caching</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="database.html" title="previous chapter">Global Database Settings</a></p> <h4>Next topic</h4> <p class="topless"><a href="encryption.html" title="next chapter">Bcfg2 Data Encryption</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/server/caching.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="encryption.html" title="Bcfg2 Data Encryption" >next</a> |</li> <li class="right" > <a href="database.html" title="Global Database Settings" >previous</a> |</li> <li><a href="../index.html">home</a> | </li> <!--<li><a href="../search.html">search</a> | </li>--> <li><a href="../help/index.html">help</a> | </li> <li><a href="../contents.html">documentation </a> »</li> <li><a href="../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="index.html" >The Bcfg2 Server</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009-2013, Narayan Desai. Last updated on Mar 20, 2013. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>