当前位置:网站首页>The introduction of MySQL memory parameters is divided into two categories: thread exclusive and global sharing
The introduction of MySQL memory parameters is divided into two categories: thread exclusive and global sharing
2022-06-24 13:20:00 【PHP Development Engineer 】
mysql The memory parameters of are Two categories: , One is the thread - only memory , One is global shared memory Thread exclusive memory :join_buffer_size、sort_buffer_size、read_buffer_size Read data buffer sequentially 、read_rnd_buffer_size Random read data buffer 、bulk_insert_buffer_size Batch insert temporary storage memory 、tmp_table_size Internal temporary tables use memory 、max_heap_table_size Memory table uses memory join_buffer_size:The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use indexes and thus perform full table scans.When Batched Key Access is used, the value of join_buffer_size defines how large the batch of keys is in each request to the storage engine For general index scanning 、 The minimum size of the buffer for a range index scan and a join that does not use an index and therefore performs a full table scan . When using batch key access ,join_buffer_size The value of defines the size of the batch key in each request to the storage engine sort_buffer_size:Each session that must perform a sort allocates a buffer of this size Each session that must perform sorting will be allocated a buffer of this size read_buffer_size:Each thread that does a sequential scan for a MyISAM table allocates a buffer of this size (in bytes) for each table it scans Yes MyISAM Each thread that sequentially scans a table assigns this size to each table it scans ( In bytes ) The buffer tmp_table_size:The maximum size of internal in-memory temporary tables. The maximum size of the internal temporary table in memory .mysql There are two kinds of temporary tables , One is to use create temporary table Created , It is called an external temporary table , One is because union、order by、group by、distinct And so on , It is called internal temporary table max_heap_table_size:This variable sets the maximum size to which user-created MEMORY tables are permitted to grow This variable sets the maximum size that a user created memory table is allowed to grow
Global shared memory :key_buffer_size(MyISAM The index buffer )、query_cache_size Amount of memory allocated for caching query results 、thread_cache_size How many threads should the server cache for reuse 、table_open_cache Number of tables opened by all threads 、binlog_cache_size Binary log buffer 、innodb_log_buffer_size Transaction log buffer 、innodb_buffer_pool_size Data and index buffers key_buffer_size:Index blocks for MyISAM tables are buffered and are shared by all threads.MyISAM The index block of the table is buffered and shared by all threads . query_cache_size:The amount of memory allocated for caching query results Amount of memory allocated for caching query results thread_cache_size:How many threads the server should cache for reuse. When a client disconnects, the client's threads are put in the cache if there are fewer than thread_cache_size threads there.The default value= 8+(max_connections/100) MySQL In order to improve the performance of the client request to create a connection process , Provides a connection pool, that is Thread_Cache pool , Put idle connection threads in the connection pool , Instead of destroying it immediately . The good thing is , When there's a new request ,mysql Will not immediately create a connection Threads , But go first Thread_Cache Find idle connection threads in the , If it exists, use , Create a new connection thread when it doesn't exist . table_open_cache:The number of open tables for all threads. Number of tables open for all threads . binlog_cache_size:The size of the cache to hold changes to the binary log during a transaction. During transaction , The size of the cache to hold changes to the binary log . innodb_log_buffer_size:The size in bytes of the buffer that InnoDB uses to write to the log files on disk.InnoDB The size in bytes of the buffer used to write log files on disk . innodb_buffer_pool_size:The size in bytes of the buffer pool, the memory area where InnoDB caches table and index data. The default value is 134217728 bytes (128MB). Byte size of buffer pool ,InnoDB Memory area for caching table and index data . The default value is 134217728 byte (128MB)
Complete example :http://github.crmeb.net/u/defu
come from “ Open source world ” , link :http://ym.baisou.ltd/post/607.html, If you want to reprint , Please indicate the source , Otherwise, the legal liability will be investigated
边栏推荐
- DTU上报的数据值无法通过腾讯云规则引擎填入腾讯云数据库中
- Cohere、OpenAI、AI21联合发布部署模型的最佳实践准则
- J'a i ouvert quelques mots d'un ami et quelques réflexions personnelles sur le livre des six ancêtres
- 申请MIMIC数据库失败怎么办?从失败到成功的经验分享给你~
- [day ui] affix component learning
- 1. Snake game design
- 16 safety suggestions from metamask project to solid programmers
- 如何高效的分析online.log
- Baidu simian: talk about persistence mechanism and rdb/aof application scenario analysis!
- RAID5 array recovery case tutorial of a company in Shanghai
猜你喜欢

Concept + formula (excluding parameter estimation)

一文讲透研发效能!您关心的问题都在

LVGL库入门教程 - 颜色和图像

“有趣” 是新时代的竞争力

Kubernetes cluster deployment

"I, an idiot, have recruited a bunch of programmers who can only" Google "

DTU上报的数据值无法通过腾讯云规则引擎填入腾讯云数据库中

Creation and use of unified links in Huawei applinking

Mlife forum | microbiome and data mining

On the value foam of digital copyright works from the controversial nature of "Meng Hua Lu"
随机推荐
CVPR 2022 | interprétation de certains documents de l'équipe technique de meituan
Leetcode 1218. 最长定差子序列
Comparator 排序函数式接口
线程同步的基石AbstractQueuedSynchronizer详解
Understanding openstack network
I enlighten a friend and my personal understanding of the six patriarchs' Tan Jing
How to efficiently analyze online log
Are you still working hard to select *? Then put away these skills
Use the open source tool k8tz to gracefully set the kubernetes pod time zone
使用 Abp.Zero 搭建第三方登录模块(一):原理篇
Brief introduction to cluster analysis
实现领域驱动设计 - 使用ABP框架 - 创建实体
简述聚类分析
脚本之美│VBS 入门交互实战
手机开户后多久才能通过?在线开户安全么?
Main steps of system test
"Interesting" is the competitiveness of the new era
Use abp Zero builds a third-party login module (I): Principles
问个sql view的问题
Getting started with the lvgl Library - colors and images