Hi all,
I'm trying to pull snapmirror lag info from 400 individual volumes in our cluster, which is running release 8.2.1. I can successfully get the data, but it's taking about 10 seconds per call for the API to return data from each volume. This is way too slow.
Here's an example of how I'm doing it with python:
filer = NaServer(filer_name, 1, 6)
filer.set_admin_user('admin', password)
cmd = NaElement("snapmirror-get-iter")
options = NaElement("desired-attributes")
max_records = 400
# add options
cmd.child_add(options)
cmd.child_add_string("max-records", max_records)
ret = filer.invoke_elem(cmd)
# slap all returned attributes gathered by the iterator into a dict
snaplist = dict()
snaplist = ret.child_get('attributes-list')
# grab 'lag-time' from specified volume
def lag(item):
for mirror in snaplist.children_get():
if mirror.child_get_string('destination-volume') == item:
lag = mirror.child_get_string('lag-time')
print lag
This function iterates over a list of 400 volumes.
The cluster is performing well, without errors. There is no general slowness. The speed of getting data out of the API is consistent, whether the query is coming from inside the same datacenter or remotely.
Is the API supposed to be this slow? Is there a faster way to do this?
Thanks,
Jason