Let’s use this thread to explore options for speeding up
Here’s my understanding of the problem: When deployments have many models, say over 100, under control,
juju status can take multiple seconds to return. This problem is especially bad when the underlying MongoDB instance is under I/O heavy load.
As a starting suggestion, what about a
--stale-okay flag? Hear me out …
If people are just calling
juju status to check if the system is alive, perhaps we don’t need to check the state of every running instance? Perhaps we’re mainly interested in the controller’s health.
juju status --stale-okay would returned a canned response saved as a file on disk (similar to the
juju controllers command) but might ping the controller via
ps (or other some other command, perhaps we hit the API server with a request).
juju status --stale-okay could additionally trigger a new canned response to be generated asynchronously. That way the stale info would never be too stale.