ContainerBucket excessively queries container state |
|||||
Issue descriptionContainerBucket.get_all queries the state of all containers on the host every time it is called. This is probably excessive, especially in cases like ContainerBucket.get, where the state of every container gets queried when all that is needed is a single (named) container. - Putting a cache in place could reduce the incidence of container querying. - ContainerBucket.get does not need to call ContainerBucket.get_all since we already know the name of the container we're trying to get.
,
Dec 6 2017
,
Dec 6 2017
,
Jan 18 2018
,
Jan 26 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/7e32d53828e4e4bc9592efb01605970ab94569a8 commit 7e32d53828e4e4bc9592efb01605970ab94569a8 Author: Jacob Kopczynski <jkop@google.com> Date: Fri Jan 26 03:49:17 2018 container_pool: Add caching for ContainerBucket Calls to get_all and get_container now add their results to an instance-level container cache, and check whether one exists before creating a new instance from the retrieved info. This cache is rudimentary; nothing will expire unless get_all is called with force_update=True, and all data will be assumed valid until updated. BUG= chromium:784648 TEST=existing unit tests Change-Id: I102a2f8eb8c98354f637ca7fb260952253eb9a26 Reviewed-on: https://chromium-review.googlesource.com/874729 Commit-Ready: Jacob Kopczynski <jkop@chromium.org> Tested-by: Jacob Kopczynski <jkop@chromium.org> Reviewed-by: Dan Shi <dshi@google.com> [modify] https://crrev.com/7e32d53828e4e4bc9592efb01605970ab94569a8/site_utils/lxc/container_bucket.py
,
Jan 26 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/5f19911cbf78b9863e753c74acd7fd5941d465ca commit 5f19911cbf78b9863e753c74acd7fd5941d465ca Author: Jacob Kopczynski <jkop@google.com> Date: Fri Jan 26 22:22:28 2018 lxc: limit container gets to only needed instances Existing code creates an instance object for every container, even for a get that only needs one, already-known container. This creates just the one requested. TEST=existing unit tests BUG= chromium:784648 Change-Id: Iec78318ed8a1b031cdddc984faae129a0a7f0288 Reviewed-on: https://chromium-review.googlesource.com/875256 Commit-Ready: Jacob Kopczynski <jkop@chromium.org> Tested-by: Jacob Kopczynski <jkop@chromium.org> Reviewed-by: Jacob Kopczynski <jkop@chromium.org> [modify] https://crrev.com/5f19911cbf78b9863e753c74acd7fd5941d465ca/site_utils/lxc/container.py [modify] https://crrev.com/5f19911cbf78b9863e753c74acd7fd5941d465ca/site_utils/lxc/container_bucket.py
,
Jan 26 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by nxia@chromium.org
, Nov 15 2017