在mariadb 10.1版本中,在information_schema.processlist表中,新增了几个字段,其中有一个memory_used,其记录的是连接的内存消耗。

同时新增了一个状态变量memory_used,其记录的应该是所有连接加起来消耗的内存(官方并没有特别详细地解释https://mariadb.com/kb/en/mariadb/show-processlist/),应该类似于oracle pga的概念。

为了再检查下mysql占用内存远超过buffer pool的原因,我们特地让运维将某个线上实例从percona切换到了mariadb 10.1.21进行观察。如下:

[root@iZbp13xgu1d7hpg1gca4ndZ ~]# mysql -uroot -pmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 1046786
Server version: 10.1.20-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show status like '%memory_used%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Memory_used | 67464 |
+---------------+-------+
1 row in set (0.00 sec) MariaDB [(none)]> show global status like '%memory_used%';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| Memory_used | 568761128 |
+---------------+-----------+
1 row in set (0.00 sec) MariaDB [(none)]> select user,host,memory_used from information_schema.processlist;
+-----------------+----------------------+-------------+
| user | host | memory_used |
+-----------------+----------------------+-------------+
| root | localhost | 84576 |
| osm | 10.253.106.167:47847 | 95376 |
| osm | 10.253.106.167:47843 | 94616 |
| osm | 10.253.106.167:47845 | 94224 |
| osm | 10.253.106.167:47841 | 93856 |
| osm | 10.253.106.167:47835 | 94224 |
| osm | 10.253.106.167:47836 | 94616 |
| osm | 10.253.106.167:47831 | 67464 |
| osm | 10.253.106.167:47832 | 67464 |
| osm | 10.253.106.167:47815 | 71312 |
| osm | 10.253.106.167:47791 | 67464 |
| osm | 10.253.106.167:47792 | 67464 |
| osm | 10.253.106.167:47780 | 67464 |
| event_scheduler | localhost | 39784 |
+-----------------+----------------------+-------------+
14 rows in set (0.00 sec)

在其内存输出中,没有办法得出global memory_used是如何组成的?processlist汇总起来也不是这个值,这确实比较奇怪,官方和各种forum也没找到各种解释。。。

该服务器buffer pool配置的是4GB,外有一些临时表在用,当前的进程内存消耗如下:

所以,就算4GB+memory_used也差不多4.55G差不多,和实际的6.4G差距还是蛮大的,看来mysql在这方面还是需要有较大的改进。

mariadb 10.1查看per connection内存消耗的更多相关文章

  1. Docker MariaDB 10.3 Galera Cluster 集群同步复制 多主 Docker Haproxy 负载均衡

    mariadb 现有动态列,支持json格式存储,类似mongodb的bson,但是操作能力较为尴尬,中间件有spider,我非常感兴趣的一个东西 关于spider 这里有一篇很好的博文,有时间一定得 ...

  2. windows下使用adb工具查看android程序cpu和内存消耗情况

    在实际的开发当中,尤其软件运行在一个硬件设备比较差的环境下,对软件占用资源大的问题是开发者们必须要解决的问题,系统比较卡.觉得应该看看程序的cpu和内存消耗 一直以来都在windows下编程,已经习惯 ...

  3. Linux学习总结(10)——Linux查看CPU和内存使用情况

    在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据相应信息分析系统状况的需要.在 CentOS 中,可以通过 top 命令来查看 CPU 使用状况.运行 top 命令后,CPU 使用状态会 ...

  4. MySQL与MariaDB核心特性比较详细版v1.0(覆盖mysql 8.0/mariadb 10.3,包括优化、功能及维护)

    注:本文严禁任何形式的转载,原文使用word编写,为了大家阅读方便,提供pdf版下载. MySQL与MariaDB主要特性比较详细版v1.0(不含HA).pdf 链接:https://pan.baid ...

  5. Linux查看CPU和内存使用情况(转)

    在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据相应信息分析系统状况的需要.在 CentOS 中,可以通过 top 命令来查看 CPU 使用状况.运行 top 命令后,CPU 使用状态会 ...

  6. Linux查看CPU和内存使用情况

    在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据相应信息分析系统状况的需要.在 CentOS 中,可以通过 top 命令来查看 CPU 使用状况.运行 top 命令后,CPU 使用状态会 ...

  7. Linux查看CPU和内存使用情况【转】

    转自:http://www.cnblogs.com/xd502djj/archive/2011/03/01/1968041.html 在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据相应 ...

  8. 【转】Linux查看CPU和内存使用情况

    =====================================top============================================== 在系统维护的过程中,随时可 ...

  9. Linux查看CPU和内存使用情况 【转】

    Linux查看CPU和内存使用情况 在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据相应信息分析系统状况的需要.在 CentOS 中,可以通过 top 命令来查看 CPU 使用状况.运行 ...

随机推荐

  1. 把Asp.Net Core 2.0部署在Linux上,使用Nginx代理服务器,并且用Systemctl命令以服务的方式监听项目

    在Linux上部署.net core 2.0程序: 第一步:配置Nginx代理 在/etc/nginx/sites-available/default 中添加 server { listen ; lo ...

  2. PAT甲1031 Hello World for U【字符串】

    1031 Hello World for U (20 分) Given any string of N (≥5) characters, you are asked to form the chara ...

  3. POJ3268 Silver Cow Party【最短路】

    One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big co ...

  4. ubuntu16.04下安装Eigen

    请输入以下命令进行安装: sudo apt-get install libeigen3-dev 一个库由头文件和库文件组成.Eigen头文件的默认位置在 “usr/include/eigen3” 中. ...

  5. 迷宫问题---poj3984(bfs,输出路径问题)

    题目链接 主要就是输出路径问题: pre[x][y]表示到达(x,y)是由点(pre[x][y].x,  pre[x][y].y)而来: #include<stdio.h> #includ ...

  6. Distribution(F题)---第八届河南省程序设计大赛

    Description One day , Wang and Dong in the Dubai desert expedition, discovered an ancient castle. Fo ...

  7. 关于Ubuntu中Could not get lock /var/lib/dpkg/lock解决方案

    在Ubuntu中,有时候运用sudo  apt-get install 安装软件时,会出现一下的情况 E: Could not get lock /var/lib/dpkg/lock - open ( ...

  8. IP追踪

    cmd里输入:tracert www.baidu.com 上图箭头方框中就是对应公司的总网IP

  9. PAT 1045 Favorite Color Stripe[dp][难]

    1045 Favorite Color Stripe (30)(30 分) Eva is trying to make her own color stripe out of a given one. ...

  10. soapUI-property Transfer

    1.1.1  Property Transfer 创建或双击现有的Property-Transfer TestStep将打开以下窗口: 左侧的列表显示了此TestStep中配置的传输,添加和管理所需的 ...