mysql 記憶體計算 MYSQL使用記憶體計算

2021-10-18 10:02:06 字數 1189 閱讀 4892

mysql記憶體占用計算: global buffer+all thread buffer

global buffer=

innodb_buffer_pool_size 快取表資料和索引資料,加速查詢,並且使查詢結果集儲存在內以供重用,一般設定到主機記憶體的70%以下

+innodb_additional_mem_pool_size 存放資料字典資訊以及一些內部資料結構,如果資料庫的物件過多的話,該值可能需要調整,一般不做調整

+innodb_log_buffer_size 事務日誌所使用的緩衝區,當滿足innodb_flush_log_trx_commit設定的條件時,會將日誌重新整理到磁碟中。

+key_buffer_size myisam儲存引擎所需要分配的記憶體大小,預設不調整,因為一般使用innodb儲存引擎

+query_cache_size 查詢快取,高併發寫型別庫建議關閉

+table_open_cache 高速表快取數目。開始可先設定乙個稍微大的值,如根據max_connections*n,n為乙個連線中可能開啟的表的資料量。後期等執行一段時間後,可根據open_tables / opened_tables >= 0.85,open_tables / table_cache <= 0.95來進行調整。

+table_definition_cache 存放表的定義資訊.frm

+thread_cache_size 空閒執行緒快取池。如果有空閒執行緒,那麼當建立新鏈結的時候會很快進行分配

all thread buffer=

max_threads*(

read_buffer_size mysql讀入緩衝區大小。myisam引擎順序掃瞄會分配一段記憶體。另外對於所有的引擎的以下操作會使用到該read_buffer_size:使用order by進行資料行排序,bulk insert into partitions,快取巢狀查詢結果集。預設1mb,值必須是4kb的整數倍,最小8kb,最大2gb,不要設定的過大,併發高時占用記憶體過高。

+read_rnd_buffer_size

+sort_buffer_size

+join_buffer_size

+binlog_cache_size

+tmp_table_size

+thread_stack

+net_buffer_length

+bulk_insert_buffer_size)

原文:

mysql 記憶體計算 MySQL記憶體計算公式

mysql記憶體計算公式mysql used mem key buffer size query cache size tmp table size innodb buffer pool size innodb additional mem pool size innodb log buffer s...

mysql 記憶體計算 mysql 記憶體的計算方法

使用tuning primer 分析mysql 看了 後對記憶體的分配有了一些了解,分享一下 實際記憶體使用主要分為幾部分 1 全域性buffer global buffer 包括 innodb buffer pool size innodb additional mem pool size inn...

mysql初始記憶體計算 MYSQL使用記憶體計算

mysql記憶體占用計算 global buffer all thread buffer global buffer innodb buffer pool size 快取表資料和索引資料,加速查詢,並且使查詢結果集儲存在內以供重用,一般設定到主機記憶體的70 以下 innodb additional...