日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql autoextend_innodb_autoextend_increment':问题解决方法

發(fā)布時間:2024/4/14 数据库 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql autoextend_innodb_autoextend_increment':问题解决方法 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

mysql:innodb引擎部分參數(shù)性能調(diào)整

InnoDB做為MySQL目前最廣泛的事務(wù)存儲引擎,很多地方的設(shè)計和Oracle都是共通的。

下面是windows上一個MySQL默認(rèn)的參數(shù)查詢結(jié)果:

mysql> show variables like 'Innodb%';

+---------------------------------+------------------------+

| Variable_name? ?? ?? ?? ?? ?? ? | Value? ?? ?? ?? ?? ?? ?|

+---------------------------------+------------------------+

| innodb_additional_mem_pool_size | 2097152? ?? ?? ?? ?? ? |

| innodb_autoextend_increment? ???| 8? ?? ?? ?? ?? ?? ?? ? |

| innodb_buffer_pool_awe_mem_mb? ?| 0? ?? ?? ?? ?? ?? ?? ? |

| innodb_buffer_pool_size? ?? ?? ?| 8388608? ?? ?? ?? ?? ? |

| innodb_checksums? ?? ?? ?? ?? ? | ON? ?? ?? ?? ?? ?? ?? ?|

| innodb_commit_concurrency? ?? ? | 0? ?? ?? ?? ?? ?? ?? ? |

| innodb_concurrency_tickets? ?? ?| 500? ?? ?? ?? ?? ?? ???|

| innodb_data_file_path? ?? ?? ???| ibdata1:10M:autoextend |

| innodb_data_home_dir? ?? ?? ?? ?|? ?? ?? ?? ?? ?? ?? ?? ?|

| innodb_doublewrite? ?? ?? ?? ???| ON? ?? ?? ?? ?? ?? ?? ?|

| innodb_fast_shutdown? ?? ?? ?? ?| 1? ?? ?? ?? ?? ?? ?? ? |

| innodb_file_io_threads? ?? ?? ? | 4? ?? ?? ?? ?? ?? ?? ? |

| innodb_file_per_table? ?? ?? ???| OFF? ?? ?? ?? ?? ?? ???|

| innodb_flush_log_at_trx_commit??| 1? ?? ?? ?? ?? ?? ?? ? |

| innodb_flush_method? ?? ?? ?? ? |? ?? ?? ?? ?? ?? ?? ?? ?|

| innodb_force_recovery? ?? ?? ???| 0? ?? ?? ?? ?? ?? ?? ? |

| innodb_lock_wait_timeout? ?? ???| 50? ?? ?? ?? ?? ?? ?? ?|

| innodb_locks_unsafe_for_binlog??| OFF? ?? ?? ?? ?? ?? ???|

| innodb_log_arch_dir? ?? ?? ?? ? |? ?? ?? ?? ?? ?? ?? ?? ?|

| innodb_log_archive? ?? ?? ?? ???| OFF? ?? ?? ?? ?? ?? ???|

| innodb_log_buffer_size? ?? ?? ? | 1048576? ?? ?? ?? ?? ? |

| innodb_log_file_size? ?? ?? ?? ?| 10485760? ?? ?? ?? ?? ?|

| innodb_log_files_in_group? ?? ? | 2? ?? ?? ?? ?? ?? ?? ? |

| innodb_log_group_home_dir? ?? ? | .\? ?? ?? ?? ?? ?? ?? ?|

| innodb_max_dirty_pages_pct? ?? ?| 90? ?? ?? ?? ?? ?? ?? ?|

| innodb_max_purge_lag? ?? ?? ?? ?| 0? ?? ?? ?? ?? ?? ?? ? |

| innodb_mirrored_log_groups? ?? ?| 1? ?? ?? ?? ?? ?? ?? ? |

| innodb_open_files? ?? ?? ?? ?? ?| 300? ?? ?? ?? ?? ?? ???|

| innodb_rollback_on_timeout? ?? ?| OFF? ?? ?? ?? ?? ?? ???|

| innodb_support_xa? ?? ?? ?? ?? ?| ON? ?? ?? ?? ?? ?? ?? ?|

| innodb_sync_spin_loops? ?? ?? ? | 20? ?? ?? ?? ?? ?? ?? ?|

| innodb_table_locks? ?? ?? ?? ???| ON? ?? ?? ?? ?? ?? ?? ?|

| innodb_thread_concurrency? ?? ? | 8? ?? ?? ?? ?? ?? ?? ? |

| innodb_thread_sleep_delay? ?? ? | 10000? ?? ?? ?? ?? ?? ?|

+---------------------------------+------------------------+

innodb_additional_mem_pool_size

用于緩存InnoDB數(shù)據(jù)字典及其他內(nèi)部結(jié)構(gòu)的內(nèi)存池大小,類似于Oracle的library cache。這不是一個強(qiáng)制參數(shù),可以被突破。

innodb_buffer_pool_size

內(nèi)存緩沖池大小,用于緩存表和索引數(shù)據(jù)等。類似于Oracle的buffer cache,如果可能,盡可能的設(shè)置大一點。

innodb_log_buffer_size

日志緩沖區(qū)大小,類似于Oracle的log buffer

innodb_log_file_size

日志文件大小。默認(rèn)會創(chuàng)建2個5M大小的名為ib_logfile0和ib_logfile1的文件。日志文件的數(shù)目由參數(shù)innodb_log_files_in_group指定。存放位置由innodb_log_group_home_dir指定。

innodb_data_file_path

指定InnoDB表空間數(shù)據(jù)文件名,大小以及其他屬性。所有文件的加起來不能少于10M。多個數(shù)據(jù)文件之間以逗號分割,屬性之間以冒號分割。默認(rèn)創(chuàng)建一個大小10MB名為ibdata1的可自動擴(kuò)展的數(shù)據(jù)文件,一般在生產(chǎn)環(huán)境中都需要根據(jù)實際情況指定,由于往表空間中添加數(shù)據(jù)文件需要停機(jī),盡量在規(guī)劃的時候做好準(zhǔn)備,如果可以的話最好開啟最后一個數(shù)據(jù)文件的自動增長屬性。數(shù)據(jù)文件的個數(shù)在規(guī)劃的時候還需要考慮另外一個innodb_open_files參數(shù)。

innodb_file_per_table

取值為ON或者OFF。是否為每個table使用單獨的數(shù)據(jù)文件保存。如果系統(tǒng)中表的個數(shù)不多,并且沒有超大表,使用該參數(shù)可以使得各個表之間的維護(hù)相對獨立,有一定的好處。

innodb_autoextend_increment

當(dāng)自動擴(kuò)展表空間被填滿之時,每次擴(kuò)展空間的大小,默認(rèn)值是8(單位MB)。該參數(shù)可以動態(tài)修改:

mysql> set global innodb_autoextend_increment=10;

Query OK, 0 rows affected (0.01 sec)

innodb_status_file

定期將show inndb status的結(jié)果輸出保存到文件中,建議開啟以便分析性能。

2007 12:53] mike mike

Description:

The variable "innodb_autoextend_increment" does not seem to report the proper value. The

top value it will display is 1000; I assume that is bytes.

From the manual:

"The increment is 8MB at a time by default. It can be modified by changing the

innodb_autoextend_increment system variable."

I have it set in my my.cnf for 128M (assuming it will grow on demand by 128 meg chunks) -

however, I noticed that my database wasn't growing that large, it was always idling around

4,096KB free.

How to repeat:

Here is my configuration:

+---------------------------------+-------------------------+

| Variable_name? ?? ?? ?? ?? ?? ? | Value? ?? ?? ?? ?? ?? ? |

+---------------------------------+-------------------------+

| have_innodb? ?? ?? ?? ?? ?? ?? ?| YES? ?? ?? ?? ?? ?? ?? ?|

| innodb_additional_mem_pool_size | 33554432? ?? ?? ?? ?? ? |

| innodb_autoextend_increment? ???| 1000? ?? ?? ?? ?? ?? ???|

| innodb_buffer_pool_awe_mem_mb? ?| 0? ?? ?? ?? ?? ?? ?? ???|

| innodb_buffer_pool_size? ?? ?? ?| 536870912? ?? ?? ?? ?? ?|

| innodb_checksums? ?? ?? ?? ?? ? | ON? ?? ?? ?? ?? ?? ?? ? |

| innodb_commit_concurrency? ?? ? | 0? ?? ?? ?? ?? ?? ?? ???|

| innodb_concurrency_tickets? ?? ?| 500? ?? ?? ?? ?? ?? ?? ?|

| innodb_data_file_path? ?? ?? ???| ibdata:1024M:autoextend |

| innodb_data_home_dir? ?? ?? ?? ?| /var/lib/mysql/? ?? ?? ?|

| innodb_doublewrite? ?? ?? ?? ???| ON? ?? ?? ?? ?? ?? ?? ? |

| innodb_fast_shutdown? ?? ?? ?? ?| 1? ?? ?? ?? ?? ?? ?? ???|

| innodb_file_io_threads? ?? ?? ? | 4? ?? ?? ?? ?? ?? ?? ???|

| innodb_file_per_table? ?? ?? ???| ON? ?? ?? ?? ?? ?? ?? ? |

| innodb_flush_log_at_trx_commit??| 0? ?? ?? ?? ?? ?? ?? ???|

| innodb_flush_method? ?? ?? ?? ? |? ?? ?? ?? ?? ?? ?? ?? ? |

| innodb_force_recovery? ?? ?? ???| 0? ?? ?? ?? ?? ?? ?? ???|

| innodb_lock_wait_timeout? ?? ???| 50? ?? ?? ?? ?? ?? ?? ? |

| innodb_locks_unsafe_for_binlog??| OFF? ?? ?? ?? ?? ?? ?? ?|

| innodb_log_arch_dir? ?? ?? ?? ? |? ?? ?? ?? ?? ?? ?? ?? ? |

| innodb_log_archive? ?? ?? ?? ???| OFF? ?? ?? ?? ?? ?? ?? ?|

| innodb_log_buffer_size? ?? ?? ? | 8388608? ?? ?? ?? ?? ???|

| innodb_log_file_size? ?? ?? ?? ?| 5242880? ?? ?? ?? ?? ???|

| innodb_log_files_in_group? ?? ? | 2? ?? ?? ?? ?? ?? ?? ???|

| innodb_log_group_home_dir? ?? ? | ./? ?? ?? ?? ?? ?? ?? ? |

| innodb_max_dirty_pages_pct? ?? ?| 90? ?? ?? ?? ?? ?? ?? ? |

| innodb_max_purge_lag? ?? ?? ?? ?| 0? ?? ?? ?? ?? ?? ?? ???|

| innodb_mirrored_log_groups? ?? ?| 1? ?? ?? ?? ?? ?? ?? ???|

| innodb_open_files? ?? ?? ?? ?? ?| 300? ?? ?? ?? ?? ?? ?? ?|

| innodb_support_xa? ?? ?? ?? ?? ?| ON? ?? ?? ?? ?? ?? ?? ? |

| innodb_sync_spin_loops? ?? ?? ? | 20? ?? ?? ?? ?? ?? ?? ? |

| innodb_table_locks? ?? ?? ?? ???| ON? ?? ?? ?? ?? ?? ?? ? |

| innodb_thread_concurrency? ?? ? | 2? ?? ?? ?? ?? ?? ?? ???|

| innodb_thread_sleep_delay? ?? ? | 10000? ?? ?? ?? ?? ?? ? |

+---------------------------------+-------------------------+

Easy to repeat:

mysql> show variables like 'innodb_autoextend_increment';

+-----------------------------+-------+

| Variable_name? ?? ?? ?? ?? ?| Value |

+-----------------------------+-------+

| innodb_autoextend_increment | 1000??|

+-----------------------------+-------+

1 row in set (0.00 sec)

mysql> SET GLOBAL innodb_autoextend_increment = 15;

Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'innodb_autoextend_increment';

+-----------------------------+-------+

| Variable_name? ?? ?? ?? ?? ?| Value |

+-----------------------------+-------+

| innodb_autoextend_increment | 15? ? |

+-----------------------------+-------+

1 row in set (0.00 sec)

mysql> SET GLOBAL innodb_autoextend_increment = 999999;

Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'innodb_autoextend_increment';

+-----------------------------+-------+

| Variable_name? ?? ?? ?? ?? ?| Value |

+-----------------------------+-------+

| innodb_autoextend_increment | 1000??|

+-----------------------------+-------+

1 row in set (0.00 sec)

mysql>

obviously if this has no effect in the CLI it has no effect from my.cnf.

Suggested fix:

People suggest using innodb_autoextend_increment=50M in multiple places around the net.

I've done that, but obviously can't confirm that it is working (at least from the

variable itself)

From what I can tell it does not work properly either (phpMyAdmin for example reports out

how many KB free the InnoDB engine/file has) - I definately think there is an issue with

the variable not reporting the right status; or perhaps the variable isn't working

itself. Unless there is some sort of conflicting mechanism when innodb_file_per_table is

used, then there should be something in the docs about it.

[8 Jan 2007 14:30] Heikki Tuuri

The manual says:

"

innodb_autoextend_increment

The increment size (in MB) for extending the size of an auto-extending tablespace when it

becomes full. The default value is 8.

"

Thus, 1000 corresponds to 1000 MB. The default is 8 MB.

[21 Jan 2007 6:32] mike mike

okay, so is 1000MB an invalid number? does it not accept "M" as a quantifier? as in 50M is

not 50, but will ignore that value?

if so, a LOT of people's examples around the net are incorrect. it should for sanity's

sake match the syntax for any other variable.

作者: liyihongcug

發(fā)布時間: 2010-05-14

總結(jié)

以上是生活随笔為你收集整理的mysql autoextend_innodb_autoextend_increment':问题解决方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。