Loading the host list or any host dashboard is very slow
Loading the host list or any sub dashboard takes upwards of 30s and seems to put a larger load than I was expecting on our influxdb server. Whatever queries it is doing seem to be fairly inefficient when dealing with our telegraf db which contains 250k+ series and 1100+ measurements with ~120 active hosts.
Even once the hosts dashboard is loaded it takes another 20s+ to load the apps that each host has.
Once the results are cached somewhere it's generally much faster.
Currently, we are doing show series queries. @gunnaraasen do you have ideas about how we can optimize our queries? Here is the query: https://github.com/influxdata/chronograf/blob/62da746c98f1d68fe618db608999b134263c0dd0/ui/src/hosts/apis/index.js#L59
The queries for the host page are currently
SHOW DATABASES
select mean(usage_user) from cpu where cpu = 'cpu-total' and time > now() - 10m group by host;
select mean("load1") from "system" where time > now() - 10m group by host;
select mean("Percent_Processor_Time") from win_cpu where time > now() - 10m group by host;
select mean("Processor_Queue_Length") from win_system where time > now() - 10s group by host
show series from /^apache$|^consul_health_checks$|^cpu$|^disk$|^docker$|^elasticsearch_indices$|^haproxy$|^influxdb_database$|^influxdb_httpd$|^influxdb_queryExecutor$|^influxdb_write$|^kubernetes_node$|^kubernetes_pod_container$|^kubernetes_pod_network$|^kubernetes_system_container$|^system$|^mem$|^memcached$|^mongodb$|^mysql$|^netstat$|^nginx$|^nsq_channel$|^nsq_server$|^nsq_topic$|^ping$|^postgresql$|^processes$|^redis$|^riak$|^varnish$|^win_cpu$|^win_mem$|^win_net$|^win_system$|^win_websvc$/
@gunnaraasen Seems like we could at the very least add ORDER BY DESC LIMIT 1 to the system stats. As for the show series, we are trying to find all hosts that have some data from these measurements.
We also have ~6 months worth of data so influx has to load old shards to find some of the old series with those measurements using the show series query.
Hi @unixninja92 would you be willing to run this command and let me know what the output is. influx -database <your database> -host <your influxdb host> -port <your influxdb port> -username <your username> -password <your password> -execute 'show series from /^apache$|^consul_health_checks$|^cpu$|^disk$|^docker$|^elasticsearch_indices$|^haproxy$|^influxdb_database$|^influxdb_httpd$|^influxdb_queryExecutor$|^influxdb_write$|^kubernetes_node$|^kubernetes_pod_container$|^kubernetes_pod_network$|^kubernetes_system_container$|^system$|^mem$|^memcached$|^mongodb$|^mysql$|^netstat$|^nginx$|^nsq_channel$|^nsq_server$|^nsq_topic$|^ping$|^postgresql$|^processes$|^redis$|^riak$|^varnish$|^win_cpu$|^win_mem$|^win_net$|^win_system$|^win_websvc$/' | wc -l
Also the output of
time influx -database <your database> -host <your influxdb host> -port <your influxdb port> -username <your username> -password <your password> -execute 'show series from /^apache$|^consul_health_checks$|^cpu$|^disk$|^docker$|^elasticsearch_indices$|^haproxy$|^influxdb_database$|^influxdb_httpd$|^influxdb_queryExecutor$|^influxdb_write$|^kubernetes_node$|^kubernetes_pod_container$|^kubernetes_pod_network$|^kubernetes_system_container$|^system$|^mem$|^memcached$|^mongodb$|^mysql$|^netstat$|^nginx$|^nsq_channel$|^nsq_server$|^nsq_topic$|^ping$|^postgresql$|^processes$|^redis$|^riak$|^varnish$|^win_cpu$|^win_mem$|^win_net$|^win_system$|^win_websvc$/' > /dev/null
The first command returns 57265 and the second returns 0.46s user 0.11s system 1% cpu 30.137 total.
@unixninja92 Any chance you could get us a cpu profile?
@nhaugo That was run from my latptop. Our influxdb is running on an m4.large. Do you want me to run the second command from inside our influx docker container?
@unixninja92 I've got an idea thanks to @jwilder about how we can solve this issue. I'll schedule up some time to experiment with using the method I describe here: https://github.com/influxdata/chronograf/pull/672#issuecomment-265868510
The host list is much faster now. The population of the apps column still takes a while and dashboards still take a long time to load.
yeah, the population of the apps column is kinda hairy. Would love something more precise than the show series ... command we are running. Even on our monitoring instance, that command returns 1.2 MB of data in 450 ms. I'm sure there are many other users with lots more data.
I don't know a better answer but the show series approach seems unsustainable to me
Can we check that the optimizations that were added to the host list view were also added to the application dashboards?
connect #682
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Feel free to reopen if this issue is still important to you. Thank you for your contributions.