# Memory Usage graph reports error when \>68 hosts are selected

**URL:** <https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402>\
**Category:** PMM 1.x\
**Created:** [February 7, 2017, 10:34am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402 "2017-02-07T10:34:11Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [February 11, 2017, 12:13am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/21 "2017-02-11T00:13:15Z")

</div>

Sorry, I sent the link in a rush. Here is the correct one:

[url][https://drive.google.com/file/d/0B5FL9q-xRjLJVkN5c3NtTWhfa0k/view?usp=sharing[/url]](https://drive.google.com/file/d/0B5FL9q-xRjLJVkN5c3NtTWhfa0k/view?usp=sharing%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [February 13, 2017, 12:44am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/22 "2017-02-13T00:44:34Z")

</div>

Hi ac2,

it is fully empty ☹ size is 0 bytes

---

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [February 20, 2017, 11:35am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/23 "2017-02-20T11:35:58Z")

</div>

Sorry, the file was created on a remote connection while traveling…

I have been back from holidays and generated a new file: [url][https://drive.google.com/file/d/0B5FL9q-xRjLJWFc4WEZfQTI5RzA/view?usp=sharing[/url]](https://drive.google.com/file/d/0B5FL9q-xRjLJWFc4WEZfQTI5RzA/view?usp=sharing%5B/url%5D)

Could you please check this?

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [February 21, 2017, 6:35am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/24 "2017-02-21T06:35:27Z")

</div>

is this issue connected to exact host or to any random 68 hosts?

can you choose first 67 hosts in the list without issues?  
can you choose last 67 hosts in the list without issues?  
can you choose 67 hosts in the middle of the list without issues?

---

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [February 21, 2017, 7:10am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/25 "2017-02-21T07:10:53Z")

</div>

Hi Mykola,  
actually I made a mistake while counting, the critical threshold is 68, sorry for that. Basically, the memory graph works correctly with 68 hosts selected (top, bottom, middle or punched card style doesn’t matter), fails with 69 onwards.  
I have tested version 1.1.1 without any luck, too.

Thanks

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [February 22, 2017, 1:59am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/26 "2017-02-22T01:59:15Z")

</div>

> [@](#):
>
> Our PMM server monitors 16 hosts and 59 MySQL instances.

is 59 mysql instances ran in 19 servers? or you have 78 independent servers?

lets check if we can fetch graph data directly from prometheus  
[http://PMM-SERVER-IP/prometheus/graph?g0.range\_input=12h&g0.stacked=0&g0.expr=node\_memory\_MemTotal&g0.tab=0](http://PMM-SERVER-IP/prometheus/graph?g0.range_input=12h&g0.stacked=0&g0.expr=node_memory_MemTotal&g0.tab=0)  
[http://PMM-SERVER-IP/prometheus/graph?g0.range\_input=12h&g0.stacked=0&g0.expr=node\_memory\_MemFree&g0.tab=0](http://PMM-SERVER-IP/prometheus/graph?g0.range_input=12h&g0.stacked=0&g0.expr=node_memory_MemFree&g0.tab=0)  
[http://PMM-SERVER-IP/prometheus/graph?g0.range\_input=12h&g0.stacked=0&g0.expr=node\_memory\_Buffers&g0.tab=0](http://PMM-SERVER-IP/prometheus/graph?g0.range_input=12h&g0.stacked=0&g0.expr=node_memory_Buffers&g0.tab=0)  
[http://PMM-SERVER-IP/prometheus/graph?g0.range\_input=12h&g0.stacked=0&g0.expr=node\_memory\_Cached&g0.tab=0](http://PMM-SERVER-IP/prometheus/graph?g0.range_input=12h&g0.stacked=0&g0.expr=node_memory_Cached&g0.tab=0)

---

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [February 23, 2017, 6:13am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/27 "2017-02-23T06:13:11Z")

</div>

We have 58 MySQL instances running on 16 MySQL VM, plus the PMM server is monitored, of course.

I have tried to access data directly in Prometheus and I see all the metrics for all nodes without any trouble, hence the issue seems related to Grafana.

Playing around selecting and deselecting hosts from the list, the problem appears “around” 68 hosts. Depending on the set, sometimes 67 is enough to trigger the problem, other times you need 69. So, it does not seem to be related to the number of hosts rather than the data volume to be accessed.

Thanks

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [February 24, 2017, 3:06am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/28 "2017-02-24T03:06:29Z")

</div>

1. do you see any javascript errors in the browser javascript console?
2. can you decrease resolution to 1/10  
it is needed to

- login to grafana as Admin user
- click on graph title
- click “Edit”
- choose “Metrics” tab
- change Resolution value

see screenshot

 ![resolution.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/3/347847ee9f6b2522f00f2a351395a120eb39f1b0.png)

---

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [March 3, 2017, 3:36am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/29 "2017-03-03T03:36:52Z")

</div>

Sorry for the very late reply, been very busy during the past days.  
I have tried all the possible resolutions for the Memory trend graph, but I still get the error when \>~68 hosts are selected from the list.

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [March 3, 2017, 3:45am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/30 "2017-03-03T03:45:55Z")

</div>

can you open “Developer Tools”-\>“Console” in your browser and reload page.  
do you see any javascript errors?

---

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [March 3, 2017, 3:56am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/31 "2017-03-03T03:56:35Z")

</div>

I have the following JS messages on the Console:

TypeError: Cannot read property ‘result’ of undefined  
at eval (datasource.js?bust=1488533087258:4)  
at f (boot.b8fccc44.js:52)  
at Function.Pg (boot.b8fccc44.js:53)  
at eval (datasource.js?bust=1488533087258:4)  
at g (boot.b8fccc44.js:42)  
at boot.b8fccc44.js:42  
at o.$eval (boot.b8fccc44.js:42)  
at o.$digest (boot.b8fccc44.js:42)  
at o.$apply (boot.b8fccc44.js:42)  
at boot.b8fccc44.js:42  
(anonymous) @ boot.b8fccc44.js:42  
(anonymous) @ boot.b8fccc44.js:41  
g @ boot.b8fccc44.js:42  
(anonymous) @ boot.b8fccc44.js:42  
$eval @ boot.b8fccc44.js:42  
$digest @ boot.b8fccc44.js:42  
$apply @ boot.b8fccc44.js:42  
(anonymous) @ boot.b8fccc44.js:42  
f @ boot.b8fccc44.js:40  
(anonymous) @ boot.b8fccc44.js:41  
boot.b8fccc44.js:46

Panel data error: TypeError: Cannot read property ‘result’ of undefined  
at eval (datasource.js?bust=1488533087258:4)  
at f (boot.b8fccc44.js:52)  
at Function.Pg (boot.b8fccc44.js:53)  
at eval (datasource.js?bust=1488533087258:4)  
at g (boot.b8fccc44.js:42)  
at boot.b8fccc44.js:42  
at o.$eval (boot.b8fccc44.js:42)  
at o.$digest (boot.b8fccc44.js:42)  
at o.$apply (boot.b8fccc44.js:42)  
at boot.b8fccc44.js:42

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [March 3, 2017, 4:33am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/32 "2017-03-03T04:33:55Z")

</div>

can you replace Query?

it is needed to

- login to grafana as Admin user
- click on graph title
- click “Edit”
- choose “Metrics” tab
- fully replace Query value

```auto
100 - 100 * node_memory_MemAvailable{instance=~"$host"} / (node_memory_MemTotal{instance=~"$host"} + 0.1)

```

---

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [March 3, 2017, 4:46am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/33 "2017-03-03T04:46:34Z")

</div>

I have replaced the query with the new one you sent me. In this case I see the graph only for the host “pmm-server” when All is ticked in the hosts list.

Am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [March 3, 2017, 4:49am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/34 "2017-03-03T04:49:04Z")

</div>

To be clearer, here is a screenshot:

 ![photoid=47489](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/c/c415188ebaa779160f2dd0073e2966a111db1a92.png)

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [March 3, 2017, 5:45am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/35 "2017-03-03T05:45:26Z")

</div>

Hm ☹  
screen shot looks very strange, new Query working fine on my machine ☹

can you try again to change “Resolution” and “Query” after that press “save Dashboard” button (looks like floppy disk) and make refresh.

---

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [March 3, 2017, 8:20am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/36 "2017-03-03T08:20:12Z")

</div>

I tried various combinations of changing query and resolution, with no luck so far.  
Selecting a subset of hosts (excluding pmm-server) is basically returning no data points, while with the original query I get a graph displayed. Please check the attached screenshot.

 ![photoid=47494](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/2/2ff069b6430ee810b47cd9f634b559df3cca7ed0.png)

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [March 3, 2017, 10:09am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/37 "2017-03-03T10:09:30Z")

</div>

can you try one more Query?

```auto
100 - 100 * (node_memory_MemFree{instance=~"$host"} + node_memory_Buffers{instance=~"$host"} + node_memory_Cached{instance=~"$host"}) / (node_memory_MemTotal{instance=~"$host"} + 0.1)

```

---

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [March 3, 2017, 10:14am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/38 "2017-03-03T10:14:17Z")

</div>

Yes, this fixes the problem, thanks! Should I do anything to make it persistent?

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [March 3, 2017, 10:26am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/39 "2017-03-03T10:26:45Z")

</div>

unfortunately, such changes will be overridden on PMM update.

can you check one more Query? (is very similar to current default)  
if it works fine I will commit it.

```auto
(node_memory_MemTotal{instance=~"$host"} - (node_memory_MemAvailable{instance=~"$host"} or (node_memory_MemFree{instance=~"$host"} + node_memory_Buffers{instance=~"$host"} + node_memory_Cached{instance=~"$host"}))) / ( node_memory_MemTotal{instance=~"$host"} + 0.1 ) * 100

```

---

<div class="post-metadata">

**Author:** ![ac2](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ac2](https://forums.percona.com/u/ac2)\
**Post date:** [March 3, 2017, 10:34am UTC](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402/40 "2017-03-03T10:34:33Z")

</div>

The last query you sent me returns no data points for any host (including pmm-server).

[Previous page](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402.md?page=1)

[Next page](https://forums.percona.com/t/memory-usage-graph-reports-error-when-68-hosts-are-selected/5402.md?page=3)
