博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MariaDB 10之TokuDB存储引擎
阅读量:6455 次
发布时间:2019-06-23

本文共 3244 字,大约阅读时间需要 10 分钟。

TokuDB存储引擎,你可以把它看做是ARCHIVE存储引擎的升级版,它拥有了密集压缩,并且支持事务。

压缩比:

Engine Compression Table size [MB]
InnoDB  none  2272
InnoDB  KEY_BLOCK_SIZE=8  1144
InnoDB  KEY_BLOCK_SIZE=4  584
MyISAM  none  1810
MyISAM  compressed with myisampack  809
Archive  default  211
TokuDB  ZLIB  284
TokuDB  LZMA  208

特性:

Feature Archive MyISAM (compressed) InnoDB TokuDB
only INSERTs no yes yes
Transactions no no yes yes
no no yes yes
Indexes no yes yes yes
Online DDL no no yes * yes **

MariaDB10,已经内嵌了TokuDB存储引擎,安装超简单,如下:

调优:

Configuration: what’s really important

As noted by Vadim long ago, “Tuning of TokuDB is much easier than InnoDB, there’re only a few parameters to change, and actually out-of-box things running pretty well“:

TokuDB调优比InnoDB简单的多,只是有一些参数变化,或者你直接使用默认参数,也运行的良好。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
MariaDB [(none)]> show variables like 
'%tokudb%'
;
+---------------------------------+-------------+
| Variable_name                   | Value       |
+---------------------------------+-------------+
| tokudb_alter_print_error        | OFF         |
| tokudb_analyze_time             | 5           |
| tokudb_block_size               | 4194304     |
| tokudb_cache_size               | 120926208   |
| tokudb_checkpoint_lock          | OFF         |
| tokudb_checkpoint_on_flush_logs | OFF         |
| tokudb_checkpointing_period     | 60          |
| tokudb_cleaner_iterations       | 5           |
| tokudb_cleaner_period           | 1           |
| tokudb_commit_sync              | ON          |
| tokudb_create_index_online      | ON          |
| tokudb_data_dir                 |             |
| tokudb_debug                    | 0           |
| tokudb_directio                 | OFF         |
| tokudb_disable_hot_alter        | OFF         |
| tokudb_disable_prefetching      | OFF         |
| tokudb_disable_slow_alter       | OFF         |
| tokudb_empty_scan               | rl          |
| tokudb_fs_reserve_percent       | 5           |
| tokudb_fsync_log_period         | 0           |
| tokudb_hide_default_row_format  | ON          |
| tokudb_init_flags               | 11403457    |
| tokudb_killed_time              | 4000        |
| tokudb_last_lock_timeout        |             |
| tokudb_load_save_space          | ON          |
| tokudb_loader_memory_size       | 100000000   |
| tokudb_lock_timeout             | 4000        |
| tokudb_lock_timeout_debug       | 1           |
| tokudb_log_dir                  |             |
| tokudb_max_lock_memory          | 15115776    |
| tokudb_pk_insert_mode           | 1           |
| tokudb_prelock_empty            | ON          |
| tokudb_read_block_size          | 65536       |
| tokudb_read_buf_size            | 131072      |
| tokudb_read_status_frequency    | 10000       |
| tokudb_row_format               | tokudb_zlib |
| tokudb_tmp_dir                  |             |
| tokudb_version                  | 7.1.6       |
| tokudb_write_status_frequency   | 1000        |
+---------------------------------+-------------+
39 rows 
in 
set 
(0.01 sec)

The most important of the tokudb_ variables is arguably tokudb_cache_size. The test server where I ran those tests (test01) have a little less than 1G of memory and as you can see above TokuDB is “reserving” half (50%) of them to itself. That’s the default behavior but, of course, you can change it. And you must do it if you are also going to have InnoDB tables on your server – you should not overcommit memory between InnoDB and TokuDB engines. Shlomi Noach wrote a good post explaining the main TokuDB-specific variables and what they do. It’s definitely a worth read.
(最重要的参数是tokudb_cache_size,它类似innodb_buffer_pool_size,如果你的服务器跑着两种引擎InnoDB和TokuDB,那么你得小心点了,别把内存用光了。)

参考:

注:因此引擎比较新,没有任何生产经验,可以试图把一些LOG日志表改为TokuDB引擎,这样在性能和磁盘空间使用率上都有较大幅度的提升。此外,该引擎的备份工具是收费,所以备份的时候可以采取冷备份。

参考:

本文转自hcymysql51CTO博客,原文链接:http://blog.51cto.com/hcymysql/1431698 ,如需转载请自行联系原作者
你可能感兴趣的文章
状态模式
查看>>
删除CentOS / RHEL的库和配置文件(Repositories and configuraiton files)
查看>>
DJANGO变动库的一次真实手动经历
查看>>
8个基本的引导工具的网页设计师
查看>>
【下载分】C语言for循环语句PK自我活动
查看>>
VC++获得微秒级时间的方法与技巧探讨(转)
查看>>
HDOJ-1010 Tempter of the Bone
查看>>
MySQL my.cnf参数配置优化详解
查看>>
HDU/HDOJ 2102 A计划 广度优先搜索BFS
查看>>
JavaNIO基础02-缓存区基础
查看>>
阿里 Blink 正式开源,重要优化点解读
查看>>
日本开设无人机专业,打造无人机“人才市场”
查看>>
Exchange 2013 EAC之管理员重置普通用户密码
查看>>
三线跑酷例子BlocksRun的技术点
查看>>
如何应对DDOS网络攻击
查看>>
新闻奖颁给了一个写稿机器人(来自新华社)
查看>>
Android应用程序在新的进程中启动新的Activity的方法和过程分析
查看>>
中文字符 与 十六进制Unicode编码 相互转换
查看>>
防止程序重复执行 Controling the number of application instances
查看>>
Android 网络请求超时处理方案
查看>>