chronograf icon indicating copy to clipboard operation
chronograf copied to clipboard

Chronograf process suspended by Chrome sometimes

Open jaredscheib opened this issue 9 years ago • 7 comments

I've noticed a few times recently that Chrome asks me if I want to Kill or Wait on Chronograf. @timh also mentioned that his laptop runs much hotter when he's got Chronograf running for a while. I did some basic profiling, but it would be good to think explicitly about testing for memory leaks.

jaredscheib avatar May 24 '17 18:05 jaredscheib

This may be solved by #1471

nhaugo avatar Jun 13 '17 16:06 nhaugo

I'm running the latest Chronograf RPM (as of this comment), and I see a similar problem. All I'm trying to do at this point is evaluate the frontend with a sample alert in the alert creation wizard. Chrome crashes the tab claiming it's out of memory.

My Influx query is something like this:

SELECT "value" FROM "cadvisor"."autogen"."memory_usage" WHERE time > now() - 15m GROUP BY "MESOS_TASK_ID"

(I'm using cadvisor to monitor container resource usage)

My laptop has 16GB, and other similar frontends (Kibana, Grafana) don't crash. If I were to hazard a guess, Chronograf is loading way too many points. It sort of seems like Chronograf isn't applying my grouping to the sample graph in the alert creation window, thus loading all 135,000 datapoints within the past 15 minutes into the graph (rather than the 600 or so on a per -grouping basis).

In any case, I feel like Chronograf should sample the points up to a maximum and do some interpolation (maybe with a warning if interpolation was done). It's very easy to imagine accidentally altering a query in such a way that it loads millions of datapoints and crashes your browser. (Although that's not what I'm doing in this case..)

jcmcken avatar Jul 17 '17 17:07 jcmcken

Hi @jcmcken, thanks for writing in!

So we have a new feature added in #1609 that automatically will group by. SO! The way it works is that it looks at your resolution on your screen and determines the best number points to plot.

Here is an example how to do it (this is data from my Dota 2 plugin):

SELECT mean("dire_gold_0") AS "mean_dire_gold_0" FROM "telegraf"."autogen"."dota2_live_leagues" WHERE time > :dashboardTime: GROUP BY :interval:, "match_id"

Notice the GROUP BY :interval:

So, for your query:

SELECT "value" FROM "cadvisor"."autogen"."memory_usage" WHERE time > now() - 15m GROUP BY :interval:, "MESOS_TASK_ID"

goller avatar Jul 17 '17 17:07 goller

whoops, I forgot to write about the aggregate function!

SELECT mean("value") as mean_value FROM "cadvisor"."autogen"."memory_usage" WHERE time > now() - 15m GROUP BY :interval:, "MESOS_TASK_ID"

goller avatar Jul 17 '17 17:07 goller

Thanks @goller, I did see that PR when searching for my problem. Unfortunately, the UI gives me no opportunity to alter the query before it freezes. Here's what I did:

  • Click 'Create Rule' to create an alert
  • Select 'cadvisor.autogen' as the database.
  • Select 'memory_usage' as the measurement, group by tag 'MESOS_TASK_ID'
  • Select 'value' as the field. Browser freezes.

In testing with a smaller dataset, I can see that the function can be selected after the field is selected. But I can't even get to that point. Once I select the field, the tab with Chronograf in it is dead.

Perhaps mean should just be the default function, rather than the raw datapoints?

jcmcken avatar Jul 17 '17 17:07 jcmcken

Or perhaps the sample graph should not be rendered by default if there are many points (similar to how GitHub won't show a huge diff)?

jcmcken avatar Jul 17 '17 18:07 jcmcken

closing due to inactivity

russorat avatar Dec 04 '18 17:12 russorat