From feeac1f0618e78d9c043433527c3f2efd7a2ca08 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Fri, 12 Jan 2024 17:22:44 -0600 Subject: [PATCH 01/23] Move package caching information to new subpage called Caching along with new section that describes resolve caching. Signed-off-by: brycegbrazen --- docs/source/caching.rst | 192 ++++++++++++++++++++++++++++++ docs/source/index.rst | 1 + docs/source/managing_packages.rst | 182 ---------------------------- 3 files changed, 193 insertions(+), 182 deletions(-) create mode 100644 docs/source/caching.rst diff --git a/docs/source/caching.rst b/docs/source/caching.rst new file mode 100644 index 000000000..8463604f9 --- /dev/null +++ b/docs/source/caching.rst @@ -0,0 +1,192 @@ +================= +Caching +================= + +Resolve Caching +=============== + +Resolve caching is a feature that caches resolves to a memcached server. + +TODO. + +.. _package-caching: + +Package Caching +=============== + +Package caching is a feature that copies package payloads onto local disk in +order to speed up runtime environments. For example, if your released packages +reside on shared storage (which is common), then running say, a Python process, +will fetch all source from the shared storage across your network. The point of +the cache is to copy that content locally instead, and avoid the network cost. + +.. note:: + Please note: Package caching does **NOT** cache package + definitions. Only their payloads (ie, the package root directory). + +Build behavior +-------------- + +Package caching during a package build is disabled by default. To enable caching during +a package build, you can set :data:`package_cache_during_build` to True. + +.. _enabling-package-caching: + +Enabling Package Caching +======================== + +Package caching is not enabled by default. To enable it, you need to configure +:data:`cache_packages_path` to specify a path to +store the cache in. + +You also have granular control over whether an individual package will or will +not be cached. To make a package cachable, you can set :attr:`cachable` +to False in its package definition file. Reasons you may *not* want to do this include +packages that are large, or that aren't relocatable because other compiled packages are +linked to them in a way that doesn't support library relocation. + +There are also config settings that affect cachability in the event that :attr:`cachable` +is not defined in a package's definition. For example, see +:data:`default_cachable`, :data:`default_cachable_per_package` +and :data:`default_cachable_per_repository`. + +Note that you can also disable package caching on the command line, using +:option:`rez-env --no-pkg-cache`. + +Verifying +--------- + +When you resolve an environment, you can see which variants have been cached by +noting the ``cached`` label in the right-hand column of the :ref:`rez-context` output, +as shown below: + +.. code-block:: console + + $ rez-env Flask + + You are now in a rez-configured environment. + + requested packages: + Flask + ~platform==linux (implicit) + ~arch==x86_64 (implicit) + ~os==Ubuntu-16.04 (implicit) + + resolved packages: + Flask-1.1.2 /home/ajohns/package_cache/Flask/1.1.2/d998/a (cached) + Jinja2-2.11.2 /home/ajohns/package_cache/Jinja2/2.11.2/6087/a (cached) + MarkupSafe-1.1.1 /svr/packages/MarkupSafe/1.1.1/d9e9d80193dcd9578844ec4c2c22c9366ef0b88a + Werkzeug-1.0.1 /home/ajohns/package_cache/Werkzeug/1.0.1/fe76/a (cached) + arch-x86_64 /home/ajohns/package_cache/arch/x86_64/6450/a (cached) + click-7.1.2 /home/ajohns/package_cache/click/7.1.2/0da2/a (cached) + itsdangerous-1.1.0 /home/ajohns/package_cache/itsdangerous/1.1.0/b23f/a (cached) + platform-linux /home/ajohns/package_cache/platform/linux/9d4d/a (cached) + python-3.7.4 /home/ajohns/package_cache/python/3.7.4/ce1c/a (cached) + +For reference, cached packages also have their original payload location stored to +an environment variable like so: + +.. code-block:: console + + $ echo $REZ_FLASK_ORIG_ROOT + /svr/packages/Flask/1.1.2/88a70aca30cb79a278872594adf043dc6c40af99 + +How it Works +------------ + +Package caching actually caches :doc:`variants`, not entire packages. When you perform +a resolve, or source an existing context, the variants required are copied to +local disk asynchronously (if they are cachable), in a separate process called +:ref:`rez-pkg-cache`. This means that a resolve will not necessarily use the cached +variants that it should, the first time around. Package caching is intended to have +a cumulative effect, so that more cached variants will be used over time. This is +a tradeoff to avoid blocking resolves while variant payloads are copied across +your network (and that can be a slow process). + +Note that a package cache is **not** a package repository. It is simply a store +of variant payloads, structured in such a way as to be able to store variants from +any package repository, into the one shared cache. + +Variants that are cached are assumed to be immutable. No check is done to see if +a variant's payload has changed, and needs to replace an existing cache entry. So +you should **not** enable caching on package repositories where packages may get +overwritten. It is for this reason that caching is disabled for local packages by +default (see :data:`package_cache_local`). + +Commandline Tool +---------------- + +Inspection +++++++++++ + +Use the :ref:`rez-pkg-cache` tool to view the state of the cache, and to perform +warming and deletion operations. Example output follows: + +.. code-block:: console + + $ rez-pkg-cache + Package cache at /home/ajohns/package_cache: + + status package variant uri cache path + ------ ------- ----------- ---------- + cached Flask-1.1.2 /svr/packages/Flask/1.1.2/package.py[0] /home/ajohns/package_cache/Flask/1.1.2/d998/a + cached Jinja2-2.11.2 /svr/packages/Jinja2/2.11.2/package.py[0] /home/ajohns/package_cache/Jinja2/2.11.2/6087/a + cached Werkzeug-1.0.1 /svr/packages/Werkzeug/1.0.1/package.py[0] /home/ajohns/package_cache/Werkzeug/1.0.1/fe76/a + cached arch-x86_64 /svr/packages/arch/x86_64/package.py[] /home/ajohns/package_cache/arch/x86_64/6450/a + cached click-7.1.2 /svr/packages/click/7.1.2/package.py[0] /home/ajohns/package_cache/click/7.1.2/0da2/a + cached itsdangerous-1.1.0 /svr/packages/itsdangerous/1.1.0/package.py[0] /home/ajohns/package_cache/itsdangerous/1.1.0/b23f/a + cached platform-linux /svr/packages/platform/linux/package.py[] /home/ajohns/package_cache/platform/linux/9d4d/a + copying python-3.7.4 /svr/packages/python/3.7.4/package.py[0] /home/ajohns/package_cache/python/3.7.4/ce1c/a + stalled MarkupSafe-1.1.1 /svr/packages/MarkupSafe/1.1.1/package.py[1] /home/ajohns/package_cache/MarkupSafe/1.1.1/724c/a + +Each variant is stored into a directory based on a partial hash of that variant's +unique identifier (its "handle"). The package cache is thread and multiprocess +proof, and uses a file lock to control access where necessary. + +Cached variants have one of the following statuses at any given time: + +* **copying**: The variant is in the process of being copied into the cache, and is not + yet available for use; +* **cached**: The variant has been cached and is ready for use; +* **stalled**: The variant was getting copied, but something went wrong and there is + now a partial copy present (but unused) in the cache. + +Logging ++++++++ + +Caching operations are stored into logfiles within the cache directory. To view: + +.. code-block:: console + + $ rez-pkg-cache --logs + rez-pkg-cache 2020-05-23 16:17:45,194 PID-29827 INFO Started daemon + rez-pkg-cache 2020-05-23 16:17:45,201 PID-29827 INFO Started caching of variant /home/ajohns/packages/Werkzeug/1.0.1/package.py[0]... + rez-pkg-cache 2020-05-23 16:17:45,404 PID-29827 INFO Cached variant to /home/ajohns/package_cache/Werkzeug/1.0.1/fe76/a in 0.202576 seconds + rez-pkg-cache 2020-05-23 16:17:45,404 PID-29827 INFO Started caching of variant /home/ajohns/packages/python/3.7.4/package.py[0]... + rez-pkg-cache 2020-05-23 16:17:46,006 PID-29827 INFO Cached variant to /home/ajohns/package_cache/python/3.7.4/ce1c/a in 0.602037 seconds + +Cleaning The Cache +++++++++++++++++++ + +Cleaning the cache refers to deleting variants that are stalled or no longer in use. +It isn't really possible to know whether a variant is in use, so there is a +configurable :data:`package_cache_max_variant_days` +setting, that will delete variants that have not been used (ie that have not appeared +in a created or sourced context) for more than N days. + +You can also manually remove variants from the cache using :option:`rez-pkg-cache -r`. +Note that when you do this, the variant is no longer available in the cache, +however it is still stored on disk. You must perform a clean (:option:`rez-pkg-cache --clean`) +to purge unused cache files from disk. + +You can use the :data:`package_cache_clean_limit` +setting to asynchronously perform some cleanup every time the cache is updated. If +you do not use this setting, it is recommended that you set up a cron or other form +of execution scheduler, to run :option:`rez-pkg-cache --clean` periodically. Otherwise, +your cache will grow indefinitely. + +Lastly, note that a stalled variant will not attempt to be re-cached until it is +removed by a clean operation. Using :data:`package_cache_clean_limit` will not clean +stalled variants either, as that could result in a problematic variant getting +cached, then stalled, then deleted, then cached again and so on. You must run +:option:`rez-pkg-cache --clean` to delete stalled variants. diff --git a/docs/source/index.rst b/docs/source/index.rst index 81cdaf7e0..5e80eb08d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -28,6 +28,7 @@ Welcome to rez's documentation! context_bundles suites managing_packages + caching pip .. toctree:: diff --git a/docs/source/managing_packages.rst b/docs/source/managing_packages.rst index 69d3548ff..64899dbbc 100644 --- a/docs/source/managing_packages.rst +++ b/docs/source/managing_packages.rst @@ -206,185 +206,3 @@ Via API: >>> >>> remove_packages_ignored_since(days=30) 1 - -.. _package-caching: - -Package Caching -=============== - -Package caching is a feature that copies package payloads onto local disk in -order to speed up runtime environments. For example, if your released packages -reside on shared storage (which is common), then running say, a Python process, -will fetch all source from the shared storage across your network. The point of -the cache is to copy that content locally instead, and avoid the network cost. - -.. note:: - Please note: Package caching does **NOT** cache package - definitions. Only their payloads (ie, the package root directory). - -Build behavior --------------- - -Package caching during a package build is disabled by default. To enable caching during -a package build, you can set :data:`package_cache_during_build` to True. - -.. _enabling-package-caching: - -Enabling Package Caching -======================== - -Package caching is not enabled by default. To enable it, you need to configure -:data:`cache_packages_path` to specify a path to -store the cache in. - -You also have granular control over whether an individual package will or will -not be cached. To make a package cachable, you can set :attr:`cachable` -to False in its package definition file. Reasons you may *not* want to do this include -packages that are large, or that aren't relocatable because other compiled packages are -linked to them in a way that doesn't support library relocation. - -There are also config settings that affect cachability in the event that :attr:`cachable` -is not defined in a package's definition. For example, see -:data:`default_cachable`, :data:`default_cachable_per_package` -and :data:`default_cachable_per_repository`. - -Note that you can also disable package caching on the command line, using -:option:`rez-env --no-pkg-cache`. - -Verifying ---------- - -When you resolve an environment, you can see which variants have been cached by -noting the ``cached`` label in the right-hand column of the :ref:`rez-context` output, -as shown below: - -.. code-block:: console - - $ rez-env Flask - - You are now in a rez-configured environment. - - requested packages: - Flask - ~platform==linux (implicit) - ~arch==x86_64 (implicit) - ~os==Ubuntu-16.04 (implicit) - - resolved packages: - Flask-1.1.2 /home/ajohns/package_cache/Flask/1.1.2/d998/a (cached) - Jinja2-2.11.2 /home/ajohns/package_cache/Jinja2/2.11.2/6087/a (cached) - MarkupSafe-1.1.1 /svr/packages/MarkupSafe/1.1.1/d9e9d80193dcd9578844ec4c2c22c9366ef0b88a - Werkzeug-1.0.1 /home/ajohns/package_cache/Werkzeug/1.0.1/fe76/a (cached) - arch-x86_64 /home/ajohns/package_cache/arch/x86_64/6450/a (cached) - click-7.1.2 /home/ajohns/package_cache/click/7.1.2/0da2/a (cached) - itsdangerous-1.1.0 /home/ajohns/package_cache/itsdangerous/1.1.0/b23f/a (cached) - platform-linux /home/ajohns/package_cache/platform/linux/9d4d/a (cached) - python-3.7.4 /home/ajohns/package_cache/python/3.7.4/ce1c/a (cached) - -For reference, cached packages also have their original payload location stored to -an environment variable like so: - -.. code-block:: console - - $ echo $REZ_FLASK_ORIG_ROOT - /svr/packages/Flask/1.1.2/88a70aca30cb79a278872594adf043dc6c40af99 - -How it Works ------------- - -Package caching actually caches :doc:`variants`, not entire packages. When you perform -a resolve, or source an existing context, the variants required are copied to -local disk asynchronously (if they are cachable), in a separate process called -:ref:`rez-pkg-cache`. This means that a resolve will not necessarily use the cached -variants that it should, the first time around. Package caching is intended to have -a cumulative effect, so that more cached variants will be used over time. This is -a tradeoff to avoid blocking resolves while variant payloads are copied across -your network (and that can be a slow process). - -Note that a package cache is **not** a package repository. It is simply a store -of variant payloads, structured in such a way as to be able to store variants from -any package repository, into the one shared cache. - -Variants that are cached are assumed to be immutable. No check is done to see if -a variant's payload has changed, and needs to replace an existing cache entry. So -you should **not** enable caching on package repositories where packages may get -overwritten. It is for this reason that caching is disabled for local packages by -default (see :data:`package_cache_local`). - -Commandline Tool ----------------- - -Inspection -++++++++++ - -Use the :ref:`rez-pkg-cache` tool to view the state of the cache, and to perform -warming and deletion operations. Example output follows: - -.. code-block:: console - - $ rez-pkg-cache - Package cache at /home/ajohns/package_cache: - - status package variant uri cache path - ------ ------- ----------- ---------- - cached Flask-1.1.2 /svr/packages/Flask/1.1.2/package.py[0] /home/ajohns/package_cache/Flask/1.1.2/d998/a - cached Jinja2-2.11.2 /svr/packages/Jinja2/2.11.2/package.py[0] /home/ajohns/package_cache/Jinja2/2.11.2/6087/a - cached Werkzeug-1.0.1 /svr/packages/Werkzeug/1.0.1/package.py[0] /home/ajohns/package_cache/Werkzeug/1.0.1/fe76/a - cached arch-x86_64 /svr/packages/arch/x86_64/package.py[] /home/ajohns/package_cache/arch/x86_64/6450/a - cached click-7.1.2 /svr/packages/click/7.1.2/package.py[0] /home/ajohns/package_cache/click/7.1.2/0da2/a - cached itsdangerous-1.1.0 /svr/packages/itsdangerous/1.1.0/package.py[0] /home/ajohns/package_cache/itsdangerous/1.1.0/b23f/a - cached platform-linux /svr/packages/platform/linux/package.py[] /home/ajohns/package_cache/platform/linux/9d4d/a - copying python-3.7.4 /svr/packages/python/3.7.4/package.py[0] /home/ajohns/package_cache/python/3.7.4/ce1c/a - stalled MarkupSafe-1.1.1 /svr/packages/MarkupSafe/1.1.1/package.py[1] /home/ajohns/package_cache/MarkupSafe/1.1.1/724c/a - -Each variant is stored into a directory based on a partial hash of that variant's -unique identifier (its "handle"). The package cache is thread and multiprocess -proof, and uses a file lock to control access where necessary. - -Cached variants have one of the following statuses at any given time: - -* **copying**: The variant is in the process of being copied into the cache, and is not - yet available for use; -* **cached**: The variant has been cached and is ready for use; -* **stalled**: The variant was getting copied, but something went wrong and there is - now a partial copy present (but unused) in the cache. - -Logging -+++++++ - -Caching operations are stored into logfiles within the cache directory. To view: - -.. code-block:: console - - $ rez-pkg-cache --logs - rez-pkg-cache 2020-05-23 16:17:45,194 PID-29827 INFO Started daemon - rez-pkg-cache 2020-05-23 16:17:45,201 PID-29827 INFO Started caching of variant /home/ajohns/packages/Werkzeug/1.0.1/package.py[0]... - rez-pkg-cache 2020-05-23 16:17:45,404 PID-29827 INFO Cached variant to /home/ajohns/package_cache/Werkzeug/1.0.1/fe76/a in 0.202576 seconds - rez-pkg-cache 2020-05-23 16:17:45,404 PID-29827 INFO Started caching of variant /home/ajohns/packages/python/3.7.4/package.py[0]... - rez-pkg-cache 2020-05-23 16:17:46,006 PID-29827 INFO Cached variant to /home/ajohns/package_cache/python/3.7.4/ce1c/a in 0.602037 seconds - -Cleaning The Cache -++++++++++++++++++ - -Cleaning the cache refers to deleting variants that are stalled or no longer in use. -It isn't really possible to know whether a variant is in use, so there is a -configurable :data:`package_cache_max_variant_days` -setting, that will delete variants that have not been used (ie that have not appeared -in a created or sourced context) for more than N days. - -You can also manually remove variants from the cache using :option:`rez-pkg-cache -r`. -Note that when you do this, the variant is no longer available in the cache, -however it is still stored on disk. You must perform a clean (:option:`rez-pkg-cache --clean`) -to purge unused cache files from disk. - -You can use the :data:`package_cache_clean_limit` -setting to asynchronously perform some cleanup every time the cache is updated. If -you do not use this setting, it is recommended that you set up a cron or other form -of execution scheduler, to run :option:`rez-pkg-cache --clean` periodically. Otherwise, -your cache will grow indefinitely. - -Lastly, note that a stalled variant will not attempt to be re-cached until it is -removed by a clean operation. Using :data:`package_cache_clean_limit` will not clean -stalled variants either, as that could result in a problematic variant getting -cached, then stalled, then deleted, then cached again and so on. You must run -:option:`rez-pkg-cache --clean` to delete stalled variants. From caa12fd763d69439e22c3f951f84ad2aad75f581 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Mon, 22 Jan 2024 12:17:09 -0600 Subject: [PATCH 02/23] Add doc from predat. Signed-off-by: brycegbrazen --- docs/source/caching.rst | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 8463604f9..c89716c5e 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -7,6 +7,59 @@ Resolve Caching Resolve caching is a feature that caches resolves to a memcached server. +Setup +----- + +To enable memcached caching, you need to configure the :data:`memcached_uri` config variable. This variable accepts a list of memcached uri servers or None. Example with memcached running on localhost on its default port: + +.. code-block:: console + memcached_uri = ["127.0.0.1:11211"] + +This is practically the only parameter you need to configure to enable caching of the content and location of package file definitions and resolutions in Rez. +However, several variables can be accessed to modify the default behavior: + +:data:`resolve_caching`: enabled by default; cache resolves in memcached. Note that these cache entries will be correctly invalidated if, for example, a new version of the package is released and modifies the result of an existing resolve. + +:data:`cache_package_files`: enabled by default; Cache package file definition reads to memcached. Updated package files will still be read correctly (ie, the cache invalidates when the filesystem changes). + +:data:`cache_listdir`: enabled by default; Cache directory traversals to memcached. Updated directory entries will still be read correctly (ie, the cache invalidates when the filesystem changes). + +:data:`resource_caching_maxsize`: -1 by default; The size of the local (in-process) resource cache. Resources include package families, packages and variants. A value of 0 disables caching; -1 sets a cache of unlimited size. The size refers to the number of entries, not byte count. + +:data:`memcached_package_file_min_compress_len`: 16384 by default; Bytecount beyond which memcached entries are compressed, for cached package files (such as package.yaml, package.py). Zero means never compress. + +:data:`memcached_context_file_min_compress_len`: 1 by default; Bytecount beyond which memcached entries are compressed, for cached context files (aka .rxt files). Zero means never compress. + +:data:`memcached_listdir_min_compress_len`: 16384 by default; Bytecount beyond which memcached entries are compressed, for directory listings. Zero means never compress. + +:data:`memcached_resolve_min_compress_len`: 1 by default; Bytecount beyond which memcached entries are compressed, for resolves. Zero means never compress. + + +Validate caching operation +-------------------------- +To print debugging information about memcached usage, you can temporarily declare the following variables in a terminal: + +.. code-block:: console + export REZ_DEBUG_MEMCACHE=1 (linux/macos bash) + $env:REZ_DEBUG_MEMCACHE=1 (powershell) + +or set :data:`debug_memcache` to True in you rezconfig.py. + + +Show stats from memcached server +-------------------------------- +Rez provides a command-line tool :ref:`rez-memcache` for query the memcached server and obtaining status information and statistics. + +.. code-block:: console + $ rez-memcache + + CACHE SERVER UPTIME HITS MISSES HIT RATIO MEMORY USED + ------------ ------ ---- ------ --------- ------ ---- + 127.0.0.1:11211 20 hours 27690 5205 84% 119 Gb 10 Mb (0%) + central.example.com:11211 6.2 months 19145089 456 99% 64 Mb 1.9 Mb (2%) + +Benefits and Downsides +---------------------- TODO. .. _package-caching: From 2562c18a9fad406b67f5b83eba0f983ea10aed91 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Mon, 22 Jan 2024 12:24:25 -0600 Subject: [PATCH 03/23] Add some new lines to fix issue with code blocks not appearing. Signed-off-by: brycegbrazen --- docs/source/caching.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index c89716c5e..5b1f449e6 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -40,6 +40,7 @@ Validate caching operation To print debugging information about memcached usage, you can temporarily declare the following variables in a terminal: .. code-block:: console + export REZ_DEBUG_MEMCACHE=1 (linux/macos bash) $env:REZ_DEBUG_MEMCACHE=1 (powershell) @@ -51,6 +52,7 @@ Show stats from memcached server Rez provides a command-line tool :ref:`rez-memcache` for query the memcached server and obtaining status information and statistics. .. code-block:: console + $ rez-memcache CACHE SERVER UPTIME HITS MISSES HIT RATIO MEMORY USED From b7437ff0c5956c2fc258ac8974719b2ffe1b7151 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Mon, 22 Jan 2024 12:39:41 -0600 Subject: [PATCH 04/23] Add new benefits/downsides section and fix typos, and small reorg. Signed-off-by: brycegbrazen --- docs/source/caching.rst | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 5b1f449e6..64b9ad3ed 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -15,8 +15,11 @@ To enable memcached caching, you need to configure the :data:`memcached_uri` con .. code-block:: console memcached_uri = ["127.0.0.1:11211"] -This is practically the only parameter you need to configure to enable caching of the content and location of package file definitions and resolutions in Rez. -However, several variables can be accessed to modify the default behavior: +This is the only parameter you need to configure to enable caching of the content and location of package file definitions and resolutions in Rez. + +Configuration +------------- +There are several variables that can be accessed to modify the default behavior of resolve caching: :data:`resolve_caching`: enabled by default; cache resolves in memcached. Note that these cache entries will be correctly invalidated if, for example, a new version of the package is released and modifies the result of an existing resolve. @@ -44,7 +47,7 @@ To print debugging information about memcached usage, you can temporarily declar export REZ_DEBUG_MEMCACHE=1 (linux/macos bash) $env:REZ_DEBUG_MEMCACHE=1 (powershell) -or set :data:`debug_memcache` to True in you rezconfig.py. +or set :data:`debug_memcache` to True in your rezconfig.py. Show stats from memcached server @@ -60,9 +63,16 @@ Rez provides a command-line tool :ref:`rez-memcache` for query the memcached ser 127.0.0.1:11211 20 hours 27690 5205 84% 119 Gb 10 Mb (0%) central.example.com:11211 6.2 months 19145089 456 99% 64 Mb 1.9 Mb (2%) -Benefits and Downsides ----------------------- -TODO. +Benefits +-------- +In a studio environment (with many machines), machines that perform a solve that is already cached to the +resolve cache will simply receive the cached result rather than preforming a re-solve. + +Downsides +--------- +Resolve caching has almost no downsides. Only in rare edge cases where you have to "hack" a released package into +production do you see any issues. In this case, because resolves are cached, you may receive a different package than +you expect. In this case however, it's better to just manually invalidate the cache anyway. .. _package-caching: From 031885ef7a04ab9801ad670570503b5df801231a Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Mon, 22 Jan 2024 12:49:07 -0600 Subject: [PATCH 05/23] Another small cleanup. Signed-off-by: brycegbrazen --- docs/source/caching.rst | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 64b9ad3ed..6d128750e 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -5,7 +5,8 @@ Caching Resolve Caching =============== -Resolve caching is a feature that caches resolves to a memcached server. +Resolve caching is a feature that caches resolves to a memcached (in-memory) server. Because the server is in-memory, +the full contents of the cache are lost if the memcached service shuts down by any means. Setup ----- @@ -21,21 +22,14 @@ Configuration ------------- There are several variables that can be accessed to modify the default behavior of resolve caching: -:data:`resolve_caching`: enabled by default; cache resolves in memcached. Note that these cache entries will be correctly invalidated if, for example, a new version of the package is released and modifies the result of an existing resolve. - -:data:`cache_package_files`: enabled by default; Cache package file definition reads to memcached. Updated package files will still be read correctly (ie, the cache invalidates when the filesystem changes). - -:data:`cache_listdir`: enabled by default; Cache directory traversals to memcached. Updated directory entries will still be read correctly (ie, the cache invalidates when the filesystem changes). - -:data:`resource_caching_maxsize`: -1 by default; The size of the local (in-process) resource cache. Resources include package families, packages and variants. A value of 0 disables caching; -1 sets a cache of unlimited size. The size refers to the number of entries, not byte count. - -:data:`memcached_package_file_min_compress_len`: 16384 by default; Bytecount beyond which memcached entries are compressed, for cached package files (such as package.yaml, package.py). Zero means never compress. - -:data:`memcached_context_file_min_compress_len`: 1 by default; Bytecount beyond which memcached entries are compressed, for cached context files (aka .rxt files). Zero means never compress. - -:data:`memcached_listdir_min_compress_len`: 16384 by default; Bytecount beyond which memcached entries are compressed, for directory listings. Zero means never compress. - -:data:`memcached_resolve_min_compress_len`: 1 by default; Bytecount beyond which memcached entries are compressed, for resolves. Zero means never compress. +* :data:`resolve_caching` +* :data:`cache_package_files` +* :data:`cache_listdir` +* :data:`resource_caching_maxsize` +* :data:`memcached_package_file_min_compress_len` +* :data:`memcached_context_file_min_compress_len` +* :data:`memcached_listdir_min_compress_len` +* :data:`memcached_resolve_min_compress_len` Validate caching operation From 893c80415b92c47ead43e348141de74d15854359 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Mon, 22 Jan 2024 13:01:50 -0600 Subject: [PATCH 06/23] Add cache invalidation section and more reorg Signed-off-by: brycegbrazen --- docs/source/caching.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 6d128750e..ca27c56be 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -14,6 +14,7 @@ Setup To enable memcached caching, you need to configure the :data:`memcached_uri` config variable. This variable accepts a list of memcached uri servers or None. Example with memcached running on localhost on its default port: .. code-block:: console + memcached_uri = ["127.0.0.1:11211"] This is the only parameter you need to configure to enable caching of the content and location of package file definitions and resolutions in Rez. @@ -32,7 +33,7 @@ There are several variables that can be accessed to modify the default behavior * :data:`memcached_resolve_min_compress_len` -Validate caching operation +Validating operation -------------------------- To print debugging information about memcached usage, you can temporarily declare the following variables in a terminal: @@ -43,6 +44,16 @@ To print debugging information about memcached usage, you can temporarily declar or set :data:`debug_memcache` to True in your rezconfig.py. +Cache invalidation +---------------------- +Cache entries will automatically be invalidated when a newer package version is released that would change the result +of an existing resolve. + +For example, let's say you are running rez-env with the package ``foo1+<2``, and originally, the only available +``foo`` package version is ``1.0.0``, so the cached resolve points to ``1.0.0``. However, at some point afterwards +you release a new version ``1.0.1``. The cache would invalidate for the request ``foo1+<2`` and the next resolve +would correctly retrieve package version ``1.0.1``. + Show stats from memcached server -------------------------------- From d8a0c8902e9345e1b866f136e6c793cf5e207d65 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Mon, 22 Jan 2024 13:35:27 -0600 Subject: [PATCH 07/23] Add section about cache contents Signed-off-by: brycegbrazen --- docs/source/caching.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index ca27c56be..d4a62b964 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -8,6 +8,14 @@ Resolve Caching Resolve caching is a feature that caches resolves to a memcached (in-memory) server. Because the server is in-memory, the full contents of the cache are lost if the memcached service shuts down by any means. +Cache contents +-------------- +The following information is stored to the memcached server for each solve: + +* Solver information about the previously cached solve. +* Release times information about when each package variant in the resolve was last released. +* Variant states information about the state of a variant. For example, in the 'filesystem' repository type, the 'state' is the last modified date of the file associated with the variant (perhaps a package.py). If the state of any variant has changed from a cached resolve - eg. if a file has been modified - the cached resolve is discarded. + Setup ----- From 07c179cdd0ad20f7a65241e8724bbe2e66c26dc0 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Thu, 25 Jan 2024 10:30:55 -0600 Subject: [PATCH 08/23] Update configuration section. NOTE: The caching cross reference isnt working right now. Signed-off-by: brycegbrazen --- docs/source/caching.rst | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index d4a62b964..971d8506c 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -27,18 +27,7 @@ To enable memcached caching, you need to configure the :data:`memcached_uri` con This is the only parameter you need to configure to enable caching of the content and location of package file definitions and resolutions in Rez. -Configuration -------------- -There are several variables that can be accessed to modify the default behavior of resolve caching: - -* :data:`resolve_caching` -* :data:`cache_package_files` -* :data:`cache_listdir` -* :data:`resource_caching_maxsize` -* :data:`memcached_package_file_min_compress_len` -* :data:`memcached_context_file_min_compress_len` -* :data:`memcached_listdir_min_compress_len` -* :data:`memcached_resolve_min_compress_len` +Please refer to the :ref:`caching` configuration section for a complete list of settings. Validating operation From 70820b912b69e4f6cde808a795030ea6aa588991 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Thu, 25 Jan 2024 10:36:55 -0600 Subject: [PATCH 09/23] Remove extra = from Caching header Signed-off-by: brycegbrazen --- docs/source/caching.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 971d8506c..11cd411a3 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -1,6 +1,6 @@ -================= +======= Caching -================= +======= Resolve Caching =============== From d8cf7fbe1ed40a06e4a9b9a4ca76c988ce1b24ca Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Thu, 25 Jan 2024 10:38:41 -0600 Subject: [PATCH 10/23] Move validating operation below cache invalidation. Signed-off-by: brycegbrazen --- docs/source/caching.rst | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 11cd411a3..14e3fa64b 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -29,6 +29,15 @@ This is the only parameter you need to configure to enable caching of the conten Please refer to the :ref:`caching` configuration section for a complete list of settings. +Cache invalidation +---------------------- +Cache entries will automatically be invalidated when a newer package version is released that would change the result +of an existing resolve. + +For example, let's say you are running rez-env with the package ``foo1+<2``, and originally, the only available +``foo`` package version is ``1.0.0``, so the cached resolve points to ``1.0.0``. However, at some point afterwards +you release a new version ``1.0.1``. The cache would invalidate for the request ``foo1+<2`` and the next resolve +would correctly retrieve package version ``1.0.1``. Validating operation -------------------------- @@ -41,17 +50,6 @@ To print debugging information about memcached usage, you can temporarily declar or set :data:`debug_memcache` to True in your rezconfig.py. -Cache invalidation ----------------------- -Cache entries will automatically be invalidated when a newer package version is released that would change the result -of an existing resolve. - -For example, let's say you are running rez-env with the package ``foo1+<2``, and originally, the only available -``foo`` package version is ``1.0.0``, so the cached resolve points to ``1.0.0``. However, at some point afterwards -you release a new version ``1.0.1``. The cache would invalidate for the request ``foo1+<2`` and the next resolve -would correctly retrieve package version ``1.0.1``. - - Show stats from memcached server -------------------------------- Rez provides a command-line tool :ref:`rez-memcache` for query the memcached server and obtaining status information and statistics. From 3714703142e8b123b2e9c1f74b1b07d36822d643 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Thu, 25 Jan 2024 10:39:55 -0600 Subject: [PATCH 11/23] Cleanup extra - lines Signed-off-by: brycegbrazen --- docs/source/caching.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 14e3fa64b..d7586eb8c 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -30,7 +30,7 @@ This is the only parameter you need to configure to enable caching of the conten Please refer to the :ref:`caching` configuration section for a complete list of settings. Cache invalidation ----------------------- +------------------ Cache entries will automatically be invalidated when a newer package version is released that would change the result of an existing resolve. @@ -40,7 +40,7 @@ you release a new version ``1.0.1``. The cache would invalidate for the request would correctly retrieve package version ``1.0.1``. Validating operation --------------------------- +-------------------- To print debugging information about memcached usage, you can temporarily declare the following variables in a terminal: .. code-block:: console From 4bb926fd52b7e62f8c4f86d28547d5103e994a47 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Thu, 25 Jan 2024 10:41:12 -0600 Subject: [PATCH 12/23] Reword stats section Signed-off-by: brycegbrazen --- docs/source/caching.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index d7586eb8c..4961df9ca 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -52,7 +52,8 @@ or set :data:`debug_memcache` to True in your rezconfig.py. Show stats from memcached server -------------------------------- -Rez provides a command-line tool :ref:`rez-memcache` for query the memcached server and obtaining status information and statistics. +Rez provides a command-line tool :ref:`rez-memcache` that can be used to see stats about cache misses/hits and to +reset the memcached cache. .. code-block:: console From a0f5ad761a21f0148bdfc257acf0e1ba1abc39fb Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Thu, 25 Jan 2024 10:44:49 -0600 Subject: [PATCH 13/23] Move benefits/downsides and dont make them sections. Signed-off-by: brycegbrazen --- docs/source/caching.rst | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 4961df9ca..1a9d82480 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -8,6 +8,13 @@ Resolve Caching Resolve caching is a feature that caches resolves to a memcached (in-memory) server. Because the server is in-memory, the full contents of the cache are lost if the memcached service shuts down by any means. +In a studio environment (with many machines), machines that perform a solve that is already cached to the +resolve cache will simply receive the cached result rather than preforming a re-solve. + +Resolve caching has almost no downsides. Only in rare edge cases where you have to "hack" a released package into +production do you see any issues. In this case, because resolves are cached, you may receive a different package than +you expect. In this case however, it's better to just manually invalidate the cache anyway. + Cache contents -------------- The following information is stored to the memcached server for each solve: @@ -64,17 +71,6 @@ reset the memcached cache. 127.0.0.1:11211 20 hours 27690 5205 84% 119 Gb 10 Mb (0%) central.example.com:11211 6.2 months 19145089 456 99% 64 Mb 1.9 Mb (2%) -Benefits --------- -In a studio environment (with many machines), machines that perform a solve that is already cached to the -resolve cache will simply receive the cached result rather than preforming a re-solve. - -Downsides ---------- -Resolve caching has almost no downsides. Only in rare edge cases where you have to "hack" a released package into -production do you see any issues. In this case, because resolves are cached, you may receive a different package than -you expect. In this case however, it's better to just manually invalidate the cache anyway. - .. _package-caching: Package Caching From 4c0fca898c833c6f39725fbf06ce9b49446ae6fb Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Thu, 25 Jan 2024 10:49:39 -0600 Subject: [PATCH 14/23] Add info about memcached, wording fixes Signed-off-by: brycegbrazen --- docs/source/caching.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 1a9d82480..4a4a98845 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -5,8 +5,12 @@ Caching Resolve Caching =============== -Resolve caching is a feature that caches resolves to a memcached (in-memory) server. Because the server is in-memory, -the full contents of the cache are lost if the memcached service shuts down by any means. +Resolve caching is a feature that caches resolves to a `memcached `_ (in-memory) data store. +Because the data store is in-memory, the full contents of the cache are lost if the memcached service shuts down +by any means. + +Memcached is widely used, easy to deploy (because there is no storage needed because it's a single +process/executable), and therefore only requires a simple server. In a studio environment (with many machines), machines that perform a solve that is already cached to the resolve cache will simply receive the cached result rather than preforming a re-solve. From ebc2cecea62cdff7ec3c413be74ec9416fb7784f Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Thu, 25 Jan 2024 10:50:32 -0600 Subject: [PATCH 15/23] Small wording change Signed-off-by: brycegbrazen --- docs/source/caching.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 4a4a98845..c8a56614f 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -9,7 +9,7 @@ Resolve caching is a feature that caches resolves to a `memcached Date: Thu, 25 Jan 2024 10:51:31 -0600 Subject: [PATCH 16/23] Small wording change Signed-off-by: brycegbrazen --- docs/source/caching.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index c8a56614f..8699926ce 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -83,7 +83,7 @@ Package Caching Package caching is a feature that copies package payloads onto local disk in order to speed up runtime environments. For example, if your released packages reside on shared storage (which is common), then running say, a Python process, -will fetch all source from the shared storage across your network. The point of +will load all source from the shared storage across your network. The point of the cache is to copy that content locally instead, and avoid the network cost. .. note:: From af03fa305514990661420802d189dc9ba6895af4 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Thu, 25 Jan 2024 10:52:50 -0600 Subject: [PATCH 17/23] Cleanup some package caching wording Signed-off-by: brycegbrazen --- docs/source/caching.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 8699926ce..c993e2b33 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -87,8 +87,8 @@ will load all source from the shared storage across your network. The point of the cache is to copy that content locally instead, and avoid the network cost. .. note:: - Please note: Package caching does **NOT** cache package - definitions. Only their payloads (ie, the package root directory). + Package caching does **NOT** cache package definitions. + Only their payloads (ie, the package root directory). Build behavior -------------- From 2849742584b12a9ec67bfe13f2b6acfdfd24f7db Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Fri, 26 Jan 2024 09:51:59 -0600 Subject: [PATCH 18/23] Sentence rewording Signed-off-by: brycegbrazen --- docs/source/caching.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index c993e2b33..7a6ab489d 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -10,7 +10,7 @@ Because the data store is in-memory, the full contents of the cache are lost if by any means. Memcached is widely used, easy to deploy (because there is no storage needed since it's a single -process/executable), and therefore only requires a simple server. +process/executable), and is very fast. In a studio environment (with many machines), machines that perform a solve that is already cached to the resolve cache will simply receive the cached result rather than preforming a re-solve. From 276c9b5e302adb1600c13f72a5d6e113e9eed600 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Fri, 26 Jan 2024 10:18:41 -0600 Subject: [PATCH 19/23] Update wording of setup for resolve caching Signed-off-by: brycegbrazen --- docs/source/caching.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 7a6ab489d..09f8813fd 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -30,7 +30,9 @@ The following information is stored to the memcached server for each solve: Setup ----- -To enable memcached caching, you need to configure the :data:`memcached_uri` config variable. This variable accepts a list of memcached uri servers or None. Example with memcached running on localhost on its default port: +To enable memcached caching, you need to configure the :data:`memcached_uri` config variable. +This variable accepts a list of URI to your memcached servers or None. Example with memcached running on +localhost on its default port: .. code-block:: console From 8afe28ea5ae798c814e3a219ee836c2c1d6665e7 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Sat, 27 Jan 2024 17:10:58 -0500 Subject: [PATCH 20/23] * Fix caching reference * Tweak caching docs a little bit to be more consistent with the other docs Signed-off-by: Jean-Christophe Morin --- docs/rez_sphinxext.py | 2 ++ docs/source/caching.rst | 28 +++++++++++++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/rez_sphinxext.py b/docs/rez_sphinxext.py index f5dce23ec..03252e724 100644 --- a/docs/rez_sphinxext.py +++ b/docs/rez_sphinxext.py @@ -93,6 +93,8 @@ def convert_rez_config_to_rst() -> list[str]: for section in settings: rst.append('') + rst.append(".. _config-{}:".format(section.replace(' ', '-').lower())) + rst.append("") rst.append(section) rst.append("-" * len(section)) rst.append('') diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 09f8813fd..d1d74124d 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -5,9 +5,7 @@ Caching Resolve Caching =============== -Resolve caching is a feature that caches resolves to a `memcached `_ (in-memory) data store. -Because the data store is in-memory, the full contents of the cache are lost if the memcached service shuts down -by any means. +Resolve caching is a feature that caches resolves to a `memcached `_, an in-memory database. Memcached is widely used, easy to deploy (because there is no storage needed since it's a single process/executable), and is very fast. @@ -21,11 +19,14 @@ you expect. In this case however, it's better to just manually invalidate the ca Cache contents -------------- + The following information is stored to the memcached server for each solve: -* Solver information about the previously cached solve. -* Release times information about when each package variant in the resolve was last released. -* Variant states information about the state of a variant. For example, in the 'filesystem' repository type, the 'state' is the last modified date of the file associated with the variant (perhaps a package.py). If the state of any variant has changed from a cached resolve - eg. if a file has been modified - the cached resolve is discarded. +* Solver information about previously cached solves. +* Timestamps of packages seen in previous solves. +* Variant states information about the state of a variant. For example, in the 'filesystem' repository type, + the 'state' is the last modified date of the file associated with the variant (perhaps a package.py). + If the state of any variant has changed from a cached resolve - eg. if a file has been modified - the cached resolve is discarded. Setup ----- @@ -34,16 +35,17 @@ To enable memcached caching, you need to configure the :data:`memcached_uri` con This variable accepts a list of URI to your memcached servers or None. Example with memcached running on localhost on its default port: -.. code-block:: console +.. code-block:: python memcached_uri = ["127.0.0.1:11211"] This is the only parameter you need to configure to enable caching of the content and location of package file definitions and resolutions in Rez. -Please refer to the :ref:`caching` configuration section for a complete list of settings. +Please refer to the :ref:`caching ` configuration section for a complete list of settings. Cache invalidation ------------------ + Cache entries will automatically be invalidated when a newer package version is released that would change the result of an existing resolve. @@ -54,17 +56,13 @@ would correctly retrieve package version ``1.0.1``. Validating operation -------------------- -To print debugging information about memcached usage, you can temporarily declare the following variables in a terminal: -.. code-block:: console - - export REZ_DEBUG_MEMCACHE=1 (linux/macos bash) - $env:REZ_DEBUG_MEMCACHE=1 (powershell) - -or set :data:`debug_memcache` to True in your rezconfig.py. +To print debugging information about memcached usage, you can set the :envvar:`REZ_DEBUG_MEMCACHE` environment +variable or you can use the :data:`debug_memcache` setting. Show stats from memcached server -------------------------------- + Rez provides a command-line tool :ref:`rez-memcache` that can be used to see stats about cache misses/hits and to reset the memcached cache. From dbeda38e6eebdcb7801a4db54daa596283016dbc Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Sat, 27 Jan 2024 17:16:01 -0500 Subject: [PATCH 21/23] More tweaks Signed-off-by: Jean-Christophe Morin --- docs/source/caching.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index d1d74124d..9a20d2cc3 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -11,7 +11,8 @@ Memcached is widely used, easy to deploy (because there is no storage needed sin process/executable), and is very fast. In a studio environment (with many machines), machines that perform a solve that is already cached to the -resolve cache will simply receive the cached result rather than preforming a re-solve. +resolve cache will simply receive the cached result rather than preforming a re-solve. This can significantly +decrease the time it takes to resolve environments. Slow solves will now be almost instantaneous. Resolve caching has almost no downsides. Only in rare edge cases where you have to "hack" a released package into production do you see any issues. In this case, because resolves are cached, you may receive a different package than From ae7d711146b0fa1ed5ebda3621b5f96531cb561c Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Sun, 28 Jan 2024 18:54:00 -0600 Subject: [PATCH 22/23] Quick typo fix Signed-off-by: brycegbrazen --- docs/source/caching.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 9a20d2cc3..4debab5cf 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -5,7 +5,7 @@ Caching Resolve Caching =============== -Resolve caching is a feature that caches resolves to a `memcached `_, an in-memory database. +Resolve caching is a feature that caches resolves to a `memcached `_ in-memory database. Memcached is widely used, easy to deploy (because there is no storage needed since it's a single process/executable), and is very fast. From 75997b1e840a982f1831af3978817e0e7695481b Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Mon, 29 Jan 2024 09:43:00 -0600 Subject: [PATCH 23/23] Address wording issue Signed-off-by: brycegbrazen --- docs/source/caching.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/caching.rst b/docs/source/caching.rst index 4debab5cf..6375a7e47 100644 --- a/docs/source/caching.rst +++ b/docs/source/caching.rst @@ -5,10 +5,10 @@ Caching Resolve Caching =============== -Resolve caching is a feature that caches resolves to a `memcached `_ in-memory database. +Resolve caching is a feature that caches resolves to a `memcached `_ database. Memcached is widely used, easy to deploy (because there is no storage needed since it's a single -process/executable), and is very fast. +process/executable), and is very fast due to the data residing in memory. In a studio environment (with many machines), machines that perform a solve that is already cached to the resolve cache will simply receive the cached result rather than preforming a re-solve. This can significantly