datastax / diagnostic-collection

Set of scripts for collection of diagnostic information from DSE/Cassandra clusters
Other
28 stars 35 forks source link

Cache results from docker ps command #103

Open AndrewHogg opened 2 years ago

AndrewHogg commented 2 years ago

When there are a large number of nodes, the loop for translate_ipaddresses_to_docker_container_ids runs 2 for loops inside each other: for host in ${cassandraNodes} ; do for container_id in $(docker ps -q) ; do

This results in the docker ps command being run number_of_nodes * number_of_containers_on_host, which is slow / inefficient.

michaelsembwever commented 2 years ago

Cache docker inspect too…