在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. ICSharpCode.SharpZipLib.dll 压缩多文件

    网站:http://icsharpcode.github.io/SharpZipLib/ 引用:ICSharpCode.SharpZipLib.dll private string CompassZi ...

  2. OpenCV学习笔记之课后习题练习4-1

    第四章课后练习1 1.本章完整讲述了基本的输入/输出编程以及OpenCV的数据结构.下面的练习是基于前面的知识做一些应用,为后面大程序的实现提供帮助.a.创建一个程序实现以下功能:(1)从视频文件中读 ...

  3. the command line tools

    PhpStorm 10.0.2 http://stackoverflow.com/questions/22572861/error-cant-use-subversion-command-line-c ...

  4. stack overflow underflow

    Introduction to algorithms / Thomas H. Cormen...[etal.].—3rded. If we attempt to pop an empty stack, ...

  5. 分块学习笔记qwq

    我没想到居然就学到分块了...哇我还一直觉得分块听起来挺牛逼的一直想学的来着qwq(其实之前好像vjudge上有道题是用分块做的?等下放链接qwq 所以想着就写个学习笔记趴qwq 首先知道分块的时间复 ...

  6. mysql 内置功能 事务 介绍

    事务用于将某些操作的多个SQL作为原子性操作,一旦有某一个出现错误,即可回滚到原来的状态,从而保证数据库数据完整性 创建数据库db12 create database db12 charset=utf ...

  7. 如何解决win8系统下卸载软件出现错误代码为2502和2503的问题

    1.首先打开任务管理器,可以通过右键点击桌面上的任务栏打开任务管理器,也可以通过同时按下键盘上的Ctrl+Alt+Delete键打开任务管理器. 2.打开任务管理器后,切换到“详细信息”选项卡,找到e ...

  8. PAT 1023 Have Fun with Numbers[大数乘法][一般]

    1023 Have Fun with Numbers (20)(20 分) Notice that the number 123456789 is a 9-digit number consistin ...

  9. siblings()

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  10. [LeetCode] 198. House Robber _Easy tag: Dynamic Programming

    You are a professional robber planning to rob houses along a street. Each house has a certain amount ...