Software Development Kit (SDK) and API Discussions

Slow ONTAP API response


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_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?  






Re: Slow ONTAP API response




That 10 seconds sounds a little high from previous experience, but might not be out of the realm of possibility depending on how much data is being pulled back.


In the python snippit you pasted below - is this the function that is being repeated once for each of the 400 volumes?  Or are you pulling the results of 'snapmirror-get-iter' one time and then iterating through the resulting returned data?

2021 NetApp Partner Experience Survey
PES Banner
All Community Forums