What's more efficient from a connection standpoint?

Is there a difference in running multiple tasks vs loading up multiple getters in a napalm_get task? HP devices seem to handle connections pretty poorly and inconsistently so I’m looking at ways to improve.

For example I would imagine the first would be more efficient and/or need less connection handling.

getalldata = accessHosts.run(task=napalm_get, getters=[‘mac_address_table’, ‘facts’, ‘lldp_neighbors_detail’, ‘interfaces’])

facts = accessHosts.run(task=napalm_get, getters=[“facts”])
lldpneighbors = accessHosts.run(task=napalm_get, getters=[“lldp_neighbors_detail”])
…and so on…

that’s going to depend on the connection type and the implementation of underlying library (napalm in this case). As this particular case is probably going through netmiko it shouldn’t matter as the connection is reused and it’s the same round trips for both cases (connection is reused among different tasks unless you close it explecitly)

1 Like