当前位置:网站首页>MySQL configuration improves data insertion efficiency
MySQL configuration improves data insertion efficiency
2022-06-26 13:45:00 【It's strange that the eyes are full of human fireworks】
innodb_buffer_pool_size
innodb_buffer_pool_size The default value is 32M, It can be set to 128M.
This parameter indicates mysql Of Innodb A piece of storage engine to optimize query performance Memory buffer
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 The default value is 1; Set to 0, Can increase write speed .
The value is 0: Increase write speed , But the security is poor ,mysql Server downtime may cause data loss .
The value is 1: Every time a transaction is committed or an instruction other than a transaction needs to write the log to the hard disk , This process takes a long time ;
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 The default value is 8M, It can be set to 128M
This configuration item is mainly used when tablespace When the space is full , need MySQL How much space does the system need to expand automatically , Every time tablespace Expansion will make each SQL In a waiting state . Add automatic expansion Size Can reduce the tablespace Number of automatic extensions .
show global variables like '%innodb_autoextend_increment%'
set global innodb_autoextend_increment = 128;innodb_log_buffer_size
innodb_log_buffer_size The default value is 1M, It can be set to 64M
This configuration item is used to set innodb Database engine write log cache ; Increasing this cache segment can reduce the number of times the database writes data files .
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 The default value is 48M, It can be set to 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 The default value is 4, The range of allowed values is 1~64, It is recommended to modify according to the number of server cores ,8 The core is set to 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 The default is 200,2000, Can be adjusted to 2000,10000.
show global variables like 'innodb_io_capacity%'
set global innodb_io_capacity = 2000;
set global innodb_io_capacity_max = 10000;边栏推荐
- Here Document免交互及Expect自动化交互
- [how to connect the network] Chapter 2 (Part 1): establish a connection, transmit data, and disconnect
- 7-1 n queen problem
- 遍历指定目录获取当前目录下指定后缀(如txt和ini)的文件名
- MySQL数据库讲解(四)
- Exercise set 1
- Go language - pipeline channel
- Wechat applet magic bug - choose to replace the token instead of clearing the token, wx Getstoragesync will take the old token value instead of the new token value
- Mediapipe gestures (hands)
- Create your own cross domain proxy server
猜你喜欢

ES中索引别名(alias)的到底有什么用

Bifu divides EtherCAT module into multiple synchronization units for operation -- use of sync units

MySQL数据库讲解(三)

Wechat applet magic bug - choose to replace the token instead of clearing the token, wx Getstoragesync will take the old token value instead of the new token value

Common faults of MySQL database - forgetting database password

Input text to automatically generate images. It's fun!

Zero basics of C language lesson 8: Functions

输入文本自动生成图像,太好玩了!

8.Ribbon负载均衡服务调用

Beifu cx5130 card replacement and transfer of existing authorization files
随机推荐
Use of wangeditor rich text editor
PHP非对称加密算法(RSA)加密机制设计
ES基於Snapshot(快照)的數據備份和還原
A few lines of code can realize complex excel import and export. This tool class is really powerful!
H5视频自动播放和循环播放
Chapter 10 setting up structured logging (2)
A collection of common tools for making we media videos
【HCSD应用开发实训营】一行代码秒上云评测文章—实验过程心得
虫子 内存管理 上
网络远程访问的方式使用树莓派
Detailed practical sharing, two hours of funny videos after work, earning more than 7000 a month
Bifu divides EtherCAT module into multiple synchronization units for operation -- use of sync units
7-16 monetary system I
Basic type of typescript
Network remote access using raspberry pie
Analysis of state transition diagram of Beifu NC axis
There are many contents in the widget, so it is a good scheme to support scrolling
Included angle of 3D vector
Detailed introduction to shell script (4)
D中不用GC