-
Committer:
John Arbash Meinel
-
Author(s):
John A Meinel
-
Date:
2013-06-04 11:50:12 UTC
-
mfrom:
(1211.5.8 pinger-syncall)
-
Revision ID:
john@arbash-meinel.com-20130604115012-50i2s5zyd833amnd
various: improve 'juju status' time for large envs
The net improvement is to change the time of 'juju status' in my
extra-large environment from ~120s down to about 60s.
The presence Watcher has a sync() method to grab all the currently alive
beings. The first time it does sync, it hasn't seen any beings, so it was doing
a one-by-one request for the being's sequence number and string key. This code
now just does a batch request for all beings, and uses that to populate its map.
There is a small concern that if there is a lot of churn, the total number of
beings that have ever existed will get significantly larger than the set of
currently active beings. However, fetching a batch of 750 takes 200ms, while
fetching them one by one takes 50s. So we have to have 200x more dead items than
currently living items before we break even.
R=fwereade, rog, Danilo
CC=
https://codereview.appspot.com/9302046