参考原文:

https://www.rathishkumar.in/2017/01/how-to-allocate-innodb-buffer-pool-size-in-mysql.html

查看系统cpu,内存,硬盘使用情况

、 cat /proc/cpuinfo  或者 更直观的查看cpu的型号命令:dmesg |grep -i xeon

查看内存的方法

、 cat /proc/meminfo  或者 更直观的查看内存的命令:free -m

查看硬盘大小

、df -h

这里粘贴部分原文:

What is there inside MySQL InnoDB buffer pool?

MySQL InnoDB buffer pool contains the following things inside:

Data caching - InnoDB data pages.
Indices caching - index data.
Buffering data - Dirty pages - data which are modified in memory but not yet flushed (written) to a data disk.
Internal structures - InnoDB buffer pool additionally stores the internal structures such as Adaptive Hash Index, row level locks, etc. The unit of the above-mentioned objects are calculated as - InnoDB pages. Each InnoDB pages is 16k in size.

如何最优设置:

How to deal with this situation?

When we cannot keep an entire database in memory, we should try to keep at least working data set in memory. In most cases, we are not going to process the data of an entire table, so the required data set should be in memory. So it is always better to allocate around 75% - 80% of the total available memory of server machine to innodb_buffer_pool_size.

同时文中给出了其中的一个计算方式:

How much memory should allocate to InnoDB buffer pool?

Recommended InnoDB buffer pool size based on the all InnoDB data and indices with additional % memory:

set @idbdataindx = (select sum(data_length+index_length) from information_schema.tables where engine = 'innodb');

set @ibpsG = @idbdataindx * 1.5 / (**);

select @ibpsG;

如何设置:

SHOW VARIABLES LIKE '%innodb_buffer_pool_size%';
Example:
Online method:
SET GLOBAL innodb_buffer_pool_size = ; Offline method:
innodb_buffer_pool = 26G (需要重启服务器)
SHOW VARIABLES LIKE '%innodb_buffer_pool_size%';

Example:

Online method:
SET GLOBAL innodb_buffer_pool_size = 26843545600;
Offline method:
innodb_buffer_pool = 26G 

Mysql Innodb 性能参数设置 https://www.rathishkumar.in/2017/01/how-to-allocate-innodb-buffer-pool-size-in-mysql.html的更多相关文章

  1. Tomcat性能参数设置

    Tomcat性能参数设置 Tomcat性能参数设置 博客分类: Java LinuxTomcat网络应用多线程Socket 默认参数不适合生产环境使用,因此需要修改一些参数 1.修改启动时内存参数.并 ...

  2. 关于mysql的wait_timeout参数 设置不生效的问题【转】

    关于wait_timeout 有一次去online set wait_timeout 的时候发现改了不生效,如下: mysql> show variables like 'wait_timeou ...

  3. 在线调整InnoDB Buffer Pool Size

    InnoDB Buffer Pool主要是用来缓存数据表和索引数据的内存区域,它的默认值为134217728字节(128MB).最大值取决于CPU架构;32位系统上的最大值为4294967295(23 ...

  4. MySQL——my.cnf参数设置说明

    以下为个人总结的MySQL配置文件参数说明,如有错误,烦请大佬们留言指正,本人将第一时间修改.2019-12-10 12:32:08 [mysqld] server- # Mysql唯一标识,一个集群 ...

  5. MySQL服务优化参数设置参考

    l 通用类: key_buffer_size 含义:用于索引块的缓冲区大小,增加它可得到更好处理的索引(对所有读和多重写). 影响:对于MyISAM表的影响不是很大,MyISAM会使用系统的缓存来存储 ...

  6. MySQL 连接数相关参数设置

    当我们的数据库服务器遇到如下的错误:ERROR: Too many connections 一种可能性就是我们的压力确实很大,需要增加服务器硬件资源或者增加数据库服务器.但是大多数情况下是我们的连接数 ...

  7. center os7.2 apache+php+mysql环境配置并设置https访问

    本人阿里云购买的center os7.2系统,小程序只支持https,因此需要配置https 安装apache yum -y install httpd systemctl start httpd a ...

  8. Nginx 服务器性能参数设置

    Nginx服务器性能调优 Nginx 配置文件 1.根据CPU内核数设置worker进程个数,以12核CPU为例,设置11个worker进程: worker_processes 11; worker_ ...

  9. 关于mysql的wait_timeout参数 设置不生效的问题

    关于wait_timeout 有一次去online set wait_timeout 的时候发现改了不生效,如下: mysql> show variables like 'wait_timeou ...

随机推荐

  1. Windows下 YOLOv3配置教程(YOLOv3项VS2013平台迁移的方法)

    https://blog.csdn.net/maweifei/article/details/81150489

  2. php语言介绍分析

    1,胡说八道 php设计专门用于web开发的编程语言,易学易用得到广泛应用的同时也饱受诟病,简单易学使得初学者用最短的时间很容易实现自己的WEB站点,且开源项目丰富,是中小型公司热衷的选择.但是,随着 ...

  3. sql having 函数 按匿名字段作为条件进行查询

    今天写sql 遇到一个问题 SELECT a.*, count(b.id) AS nums FROM a LEFT JOIN b ON a.id=b.a_id WHERE nums>1 这时候会 ...

  4. Yii 用户登录验证

    http://blog.sina.com.cn/s/blog_685213e70101mo4i.html 1)首先在model文件夹中新建文件 LoginForm.php 代码如下 <?php ...

  5. Spring Boot + Jpa(Hibernate) 架构基本配置

    本文转载自:https://blog.csdn.net/javahighness/article/details/53055149 1.基于springboot-1.4.0.RELEASE版本测试 2 ...

  6. ubuntu中为Pycharm添加快捷启动方式

    1. sudo gedit /usr/share/applications/Pycharm.desktop 2.在文件中添加: [Desktop Entry] Type=Application Nam ...

  7. Linux 期中架构 Ansible

    ansible  自动化软件   基于Python开发 特点概述: 配置文件不需要过多配置  了解就可以了 ###部署ansble软件 ##受控主机部署 backup   nfs01   web01 ...

  8. BCGcontrolBar(五) 对话框大小改变控件自动适应

    改变控件大小 首先在 构造函数中加入 EnableLayout(); 在OnInitDialog()函数中加入 CBCGPStaticLayout* pLayout = (CBCGPStaticLay ...

  9. git 上传本地代码到github 服务器

    git init git add . (所有文件用 点表示) git commit -m "注释语句" git remote add origin https://github.c ...

  10. spark 存储管理机制

    累加器 -- Accumulators 广播变量--Broadcast Variables 思考 回顾 存储管理模块架构--从架构上来看 存储管理模块架构--通信层 存储管理模块架构--存储层 存储管 ...