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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

twitter mysql_twitter-mysql改进点

發布時間:2023/12/4 数据库 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 twitter mysql_twitter-mysql改进点 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

目前最新的twitter-mysql版本基于mysql5.5.22,以下總結了一些比較明顯的改進點,大部分已經親自證實,其他一些諸如修復的比較次要的問題(例如編譯問題)這里暫不列出,可以詳細參閱https://github.com/twitter/mysql/wiki/Change-History

修復的bug

1.bug#60682

某些場景下,同時執行select/drop?table/rename?table/show?innodb?status時,可能會導致死鎖

使用buglist上提供的testcase在5.1.48上能重現,5518尚未重現。

2.bug#61575

當無法初始化本地native?aio時(io_setup()失敗)會crash?innodb

3.bug#64556

中斷在innodb層的查詢可能會導致不相關的warning

4.Bug#65030:

5.Bug#65061

6.?Potential security issue with Oracle MySQL

If, for whatever reason, the memcmp() call in check_scramble() returns a value with the 8 rightmost bits set to zero (e.g. 256), an invalid password could be accepted during authentication.

新特性

1.增加選項innodb_flush_dirty_pages_age,該參數的目的是為了減少頻繁的去刷新磁盤,尤其是對于命短的Ssd盤比較有用。

在磁盤比較空閑的時候,它會限制每次只刷前innodb_flush_dirty_pages_age秒的臟頁。

2.可以動態配置--replicate-*參數

用戶可以在線動態修改過濾規則而無需重啟服務器

3.增加新的選項max_statement_time參數

該參數為session級別,其目的是在服務器端限制一條語句的執行時間,單位為ms,當查詢超過該值時,會被中斷。

例如:

SELECT?MAX_STATEMENT_TIME=10?*?FROM?t1;

超過10ms則中斷查詢

還可以給每個賬戶限制時間

GRANT?...?TO?'user'@'host'?WITH?MAX_STATEMENT_TIME?10

4.集成新的information_schema表,如下:

INNODB_BUFFER_PAGE

INNODB_BUFFER_PAGE_LRU

INNODB_BUFFER_POOL_STATS

這些表顯示了比較詳細的buffer?pool信息,關于這些i_s表可以參閱MySQL5.6的文檔

5.prefetch_pages命令,允許你手動的將相應的數據或者索引頁加載到buffer?pool中,例如

root@test?09:44:18>select?engine_control(innodb,?prefetch_pages,?2,1)?as?pages;

+-------+

|?pages?|

+-------+

|?????1?|

+-------+

1?row?in?set?(0.00?sec)

通過engine_control函數來實現,其中:

第一個參數表示引擎的類別

第二個參數表示存儲引擎命令,目前為prefetch_pages

第三個參數表示space?id

第四個參數(后面可選的增加更多pageno)表示頁號

6.super-only選項,將禁止非超級用戶執行任何語句(read_only只能阻止更新語句)

7.新的協議類型protocol_mode

xxx@test?09:54:45>show?variables?like?'%protocol_mode%';

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

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

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

|?protocol_mode?|?MINIMAL_OBJECT_NAMES_IN_RESULT_SET_METADATA?|

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

這個選項只有一個值,默認為NULL,該選項可以簡化傳遞給客戶端的元數據,當設置該選項后,傳遞給客戶端的庫名,表名和列名都是空字符串(尚未證實)原文的changelog解釋如下:

This?change?introduces?a?new?protocol?mode?that?instructs?MySQL?to?empty?certain?object?names?that?are?part?of?the?result?set?metadata.?Only?the?absolutely?minimal?(or?essential)?set?of?names?is?preserved.?If?the?minimal?option?is?set,?the?database,?table?(both?original?and?aliased)?and?column?names?in?the?result?set?metadata?will?be?empty?strings.?Only?the?column?alias?name?is?preserved.

8.增加了一些新的status變量

Innodb_files_open

Innodb_files_opened

Innodb_files_closed

Innodb_tablespace_files_open

Innodb_tablespace_files_opened

Innodb_tablespace_files_closed

9.為mysqld_safe增加了新的選項:

Format

Option?File

Description

--flush-caches

flush-caches

Flush?and?purge?buffers/caches?(vm.drop_caches=3)

--numa-interleave

numa-interleave

Run?mysqld?with?its?memory?interleaved?on?all?CPUs

這部分大意是在啟動Mysqld前sync?and?drop?cache??

Added?mysqld_safe?options?to?flush?(sync?and?drop)?caches?before?starting?mysqld?and?to?set?the?NUMA?memory?allocation?policy?to?interleave

有DBA同學能夠去分析下么,看看能否將這些特性移植過來?

10.buffer?pool內存預分配

增加選項

xxx@test?10:23:11>show?variables?like?'%innodb_buffer_pool_populate%';

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

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

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

|?innodb_buffer_pool_populate?|?OFF???|

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

為buffer?pool預先分配好需要的物理內存

11.表.ibd文件預分配

增加了新的表選項min_pages,可以在create/alter?table時,指定page的大小,從而達到預分配.ibd文件的目的,對于插入很猛的應用,可以表空間擴展引起的避免抖動

例如:

root@test?10:38:44>Create?table?t1?(a?int?,b?int?)?min_pages?=?100;

Query?OK,?0?rows?affected?(0.12?sec)

$ls?-lh?t1.ibd

-rw-rw----?1?root?root?7.0M?Apr?18?10:38?t1.ibd

24號發布的新的基于mysql5.5.22的版本,還沒來得及看,先貼過來吧 :)

MYSQL-62: Replication info not available from crash recovery?

Restored code that stores the master binary log position of a slave in InnoDB's data file. Like in earlier MySQL versions, if a slave crashes, the name and position of the slave in relation to the master binary log file is printed after crash recovery.

Backport innodb_flush_neighbors from MySQL 5.6

Backported from MySQL 5.6 the?innodb_flush_neighbors?option that controls whether flushing a page from the InnoDB buffer pool also flushes other dirty pages in the same extent.

Add ability to disable anticipatory flushing

Introduced the?innodb_anticipatory_flushing?option that controls whether the master thread will flush dirty pages from the buffer pool if there is I/O bandwidth available for background tasks.

Add InnoDB flush-related status variables

Introduced status variables that provide counters for the various flushing-related tasks performed by InnoDB. For example, these counters provide information about the number of pages scanned and flushed from the flush and LRU lists. Also, there are counters for the number of pages flushed by the background thread.

總結

以上是生活随笔為你收集整理的twitter mysql_twitter-mysql改进点的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。