# pmm client side mysqld\_exporter consuming a lot of memory

**URL:** <https://forums.percona.com/t/pmm-client-side-mysqld-exporter-consuming-a-lot-of-memory/7773>\
**Category:** PMM 2.x\
**Created:** [July 14, 2020, 9:58pm UTC](https://forums.percona.com/t/pmm-client-side-mysqld-exporter-consuming-a-lot-of-memory/7773 "2020-07-14T21:58:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tyasa](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@tyasa](https://forums.percona.com/u/tyasa)\
**Post date:** [July 14, 2020, 9:58pm UTC](https://forums.percona.com/t/pmm-client-side-mysqld-exporter-consuming-a-lot-of-memory/7773/1 "2020-07-14T21:58:14Z")

</div>

Hi,  
I finally got pmm to work after opening up port 42001 42002 on my client (where the mysql db is located)  
  
While looking at the new metrics coming in, i was surprised to see memory available down to 4%. (usually around 40-50% free)  
  
Running top on the database server, i see this:  
3066 root&nbsp; &nbsp; &nbsp; 20&nbsp; &nbsp;0 2825676&nbsp; &nbsp;2.5g&nbsp; &nbsp;1240 S&nbsp; &nbsp;1.3 68.0&nbsp; &nbsp;4:41.44 mysqld\_exporter  
  
thats 68% memory held by mysqld\_exporter and it stays there.  
  
Tasks:&nbsp; 84 total,&nbsp; &nbsp;1 running,&nbsp; 83 sleeping,&nbsp; &nbsp;0 stopped,&nbsp; &nbsp;0 zombie%Cpu(s):&nbsp; 1.9 us,&nbsp; 5.5 sy,&nbsp; 0.0 ni, 65.5 id, 26.7 wa,&nbsp; 0.0 hi,&nbsp; 0.2 si,&nbsp; 0.2 stKiB Mem :&nbsp; 3880184 total,&nbsp; &nbsp;111948 free,&nbsp; 3665160 used,&nbsp; &nbsp;103076 buff/cacheKiB Swap:&nbsp; 4194300 total,&nbsp; 3543804 free,&nbsp; &nbsp;650496 used.&nbsp; &nbsp; 40916 avail Mem  
Noted that the server is on the weak side of 4GB memory. but the server is a new startup and rarely goes beyond 50% of memory usage yet.  
  
Any advice on this? Is there a setting i could set to limit memory usage by the exporter or is my server too weak to run pmm client?&nbsp;  
  
Which actually takes less memory footprint, using perfschema or slowlog? i commented slow query log in my.cnf . does it matter which is used in regards to memory taken by mysqld exporter?   
Can i reduce the sample rate / upload rate / or something to reduce memory footprint to around 10% of system memory with the side effect of not getting the full picture in the pmm dashboard?  
  
Thank you for the advice. Below are the settings for the database systems. (this is my first system that i try to manage, so i’m still learning on server management)  
  
ProjectName: pmm-adminVersion: 2.8.0PMMVersion: 2.8.0Timestamp: 2020-06-25 13:53:24 (UTC)FullCommit: 7d9e26cac82f694f1fef965fad9be862dbd7926c  
I ran the following for setup:  
sudo pmm-admin add mysql --query-source=perfschema --user=user --pass=pass --host=localhost --port=3306  
  
pmm-admin list shows the following:  
pmm\_agent&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Connected&nbsp; /agent\_id/41cc2aa9-cbb5-42f6-a7db-9f15aa7ad045node\_exporter&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Running&nbsp; &nbsp; /agent\_id/7b8c1697-932f-47d6-a81e-2bf82bcc3306mysqld\_exporter&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Running&nbsp; &nbsp; /agent\_id/0de9dcb3-6810-4695-bc55-021429dd3632&nbsp; /service\_id/2f69a203-a7af-4af8-9eee-23228592f02dmysql\_perfschema\_agent&nbsp; &nbsp; &nbsp; Running&nbsp; &nbsp; /agent\_id/9667bf76-2501-4505-82a6-36f45c8a3cdf&nbsp; /service\_id/2f69a203-a7af-4af8-9eee-23228592f02d  
my.cnf (mysql 8.0):  
innodb\_monitor\_enable=allperformance\_schema=ON  
# slow query log commented  
#log\_output=file#slow\_query\_log=ON#long\_query\_time=0#log\_slow\_admin\_statements=ON#log\_slow\_slave\_statements=ON  
[innodb]innodb\_buffer\_pool\_size = 3200M # (adjust value here, 50%-70% of total RAM)innodb\_log\_file\_size = 128Minnodb\_flush\_method = O\_DIRECTinnodb\_flush\_log\_at\_trx\_commit=1

---

<div class="post-metadata">

**Author:** ![tyasa](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@tyasa](https://forums.percona.com/u/tyasa)\
**Post date:** [July 14, 2020, 10:03pm UTC](https://forums.percona.com/t/pmm-client-side-mysqld-exporter-consuming-a-lot-of-memory/7773/2 "2020-07-14T22:03:35Z")

</div>

for additional note, i just remove (stop) mysql service using the command  
  
sudo pmm-admin remove mysql vultr.guest-mysql  
  
And the memory of my system is back to normal which usually looks like this:  
top - 03:31:13 up 15 days, 11:08,&nbsp; 1 user,&nbsp; load average: 1.86, 3.21, 3.54Tasks:&nbsp; 83 total,&nbsp; &nbsp;1 running,&nbsp; 82 sleeping,&nbsp; &nbsp;0 stopped,&nbsp; &nbsp;0 zombie%Cpu(s): 13.6 us,&nbsp; 5.6 sy,&nbsp; 0.0 ni, 79.1 id,&nbsp; 1.7 wa,&nbsp; 0.0 hi,&nbsp; 0.0 si,&nbsp; 0.0 stKiB Mem :&nbsp; 3880184 total,&nbsp; 2374220 free,&nbsp; 1081108 used,&nbsp; &nbsp;424856 buff/cacheKiB Swap:&nbsp; 4194300 total,&nbsp; 3686652 free,&nbsp; &nbsp;507648 used.&nbsp; 2523920 avail Mem  
&nbsp; PID USER&nbsp; &nbsp; &nbsp; PR&nbsp; NI&nbsp; &nbsp; VIRT&nbsp; &nbsp; RES&nbsp; &nbsp; SHR S&nbsp; %CPU %MEM&nbsp; &nbsp; &nbsp;TIME+ COMMAND&nbsp;2933 mysql&nbsp; &nbsp; &nbsp;20&nbsp; &nbsp;0 2141744 979804&nbsp; &nbsp;5028 S&nbsp; 37.9 25.3&nbsp; 25:37.32 mysqld

---

<div class="post-metadata">

**Author:** ![alexey.palazhchenko](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alexey.palazhchenko/32/35_2.png) [@alexey.palazhchenko](https://forums.percona.com/u/alexey.palazhchenko)\
**Post date:** [July 15, 2020, 9:27am UTC](https://forums.percona.com/t/pmm-client-side-mysqld-exporter-consuming-a-lot-of-memory/7773/3 "2020-07-15T09:27:55Z")

</div>

Hi. That sounds like a severe problem. May you please create a bug in our Jira at [https://jira.percona.com/projects/PMM](https://jira.percona.com/projects/PMM)? And please also attach a memory profile file. You can create it with `curl http://127.0.0.1:42001/debug/pprof/heap &gt; heap.pb.gz` where 42001 is a mysqld\_exporter port. That file will not contain any sensitive information.
