当前位置:网站首页>mysql配置提高数据插入效率
mysql配置提高数据插入效率
2022-06-26 12:53:00 【怪只怪满眼尽是人间烟火】
innodb_buffer_pool_size
innodb_buffer_pool_size 默认值为32M,可以设置成128M。
该参数表示mysql 的Innodb存储引擎为优化查询性能而开辟出的一块内存缓冲区
show global VARIABLES like 'innodb_buffer_pool_size'
set global innodb_buffer_pool_size=1024*1024*128;innodb_flush_log_at_trx_commit
innodb_flush_log_at_trx_commit 默认值为1;设置为0,可以提高写入速度。
值为0:提升写入速度,但是安全方面较差,mysql服务器宕机可能会造成数据丢失。
值为1:每一次事务提交或者事务外的指令都需要把日志写入硬盘,此过程消耗时间较长;
show global variables like '%innodb_flush_log_at_trx_commit%'
set global innodb_flush_log_at_trx_commit=0;innodb_autoextend_increment
innodb_autoextend_increment 默认值是8M,可以设置成128M
此配置项作用主要是当tablespace 空间已经满了后,需要MySQL系统需要自动扩展多少空间,每次tablespace 扩展都会让各个SQL 处于等待状态。增加自动扩展Size可以减少tablespace自动扩展次数。
show global variables like '%innodb_autoextend_increment%'
set global innodb_autoextend_increment = 128;innodb_log_buffer_size
innodb_log_buffer_size默认值是1M,可以设置成64M
此配置项作用设定innodb 数据库引擎写日志缓存区;将此缓存段增大可以减少数据库写数据文件次数。
show global variables like '%innodb_log_buffer_size%'
set global innodb_log_buffer_size = 1024*1024*64;innodb_log_file_size
innodb_log_file_size 默认值是48M,可以设置成128M
show global variables like '%innodb_log_file_size%'
set global innodb_log_file_size = 1024*1024*128;innodb_write_io_threads & innodb_read_io_threads
innodb_write_io_threads & innodb_read_io_threads 默认值4,允许值的范围是1~64,建议根据服务器核心数进行修改,8核就设置成8。
show global variables like '%innodb_write_io_threads%'
set global innodb_write_io_threads = 8;
show global variables like '%innodb_read_io_threads%'
set global innodb_read_io_threads = 8;innodb_io_capacity & innodb_io_capacity_max
innodb_io_capacity & innodb_io_capacity_max 默认是200,2000,可以调整成2000,10000。
show global variables like 'innodb_io_capacity%'
set global innodb_io_capacity = 2000;
set global innodb_io_capacity_max = 10000;边栏推荐
- MongoDB系列之适用场景和不适用场景
- Beifu PLC model selection -- how to see whether the motor is a multi turn absolute value encoder or a single turn absolute value encoder
- ES6 module
- Uva10341 solve it
- Learn how to develop owl components by hand (7): practical use of owl projects
- 【MySQL从入门到精通】【高级篇】(二)MySQL目录结构与表在文件系统中的表示
- 使用 Performance 看看浏览器在做什么
- What features are added to Photoshop 2022 23.4.1? Do you know anything
- Nexys A7开发板资源使用技巧
- 去某东面试遇到并发编程问题:如何安全地中断一个正在运行的线程
猜你喜欢

Update and download of Beifu EtherCAT XML description file

Firewall introduction

MongoDB系列之Window环境部署配置

ES基于Snapshot(快照)的数据备份和还原

Thinking caused by the error < note: candidate expectations 1 argument, 0 provided >

Beifu PLC realizes data power-off maintenance based on cx5130

三维向量的夹角

Beifu PLC obtains system time, local time, current time zone and system time zone conversion through program

33、使用RGBD相机进行目标检测和深度信息输出

ES6 module
随机推荐
HDU 3709 Balanced Number
imagecopymerge
es常用语法一
7-1 n queen problem
code force Party Lemonade
MySQL explanation (I)
遍历指定目录获取当前目录下指定后缀(如txt和ini)的文件名
Network remote access using raspberry pie
[MySQL from introduction to mastery] [advanced part] (II) representation of MySQL directory structure and tables in the file system
awk工具
C language: Exercise 2
Uva5009 error curves three points
Here document interaction free and expect automatic interaction
CloudCompare——泊松重建
Uva10341 solve it
ES基於Snapshot(快照)的數據備份和還原
Beifu twincat3 can read and write CSV and txt files
Uva11582 [fast power]colossal Fibonacci numbers!
I have a good word to say, and I admire myself
Arcpy - - utilisation de la fonction insertlayer (): ajout de calques dans un document de carte