简体   繁体   English

适用于MariaDB的Innodb引擎的变量

[英]Variables for Innodb engine for MariaDB

Below are the system specs for my server where i am running my MariaDB10-0.14. 以下是我运行MariaDB10-0.14的服务器的系统规格。 The OS is CentOS-6.5, and the server only hosts MariaDB and its test tools (sysbench and mysqlslap) thats it. 操作系统是CentOS-6.5,服务器仅托管MariaDB及其测试工具(sysbench和mysqlslap)。 This db server is a slave replica of another MariaDB server sitting on another machine. 此数据库服务器是位于另一台计算机上的另一台MariaDB服务器的从属副本。 There are about 1000 tables in all databases in the db server, and all tables are innodb. db服务器中所有数据库中大约有1000个表,并且所有表都是innodb。 There are more reads(400 simultaneously) than inserts (60 simultaneously) from the application, but the number of inserts is a good number too. 从应用程序中读取的次数(同时进行400次)比插入次数(同时进行60次)要多,但是插入次数也不错。 So here is some info about my linux server: 所以这是关于我的Linux服务器的一些信息:

[root ~]# df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1       18625404 7430560  10248720  43% /
tmpfs           1958396       0   1958396   0%  /dev/shm

[root ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        18G  7.1G  9.8G  43% /
tmpfs           1.9G     0  1.9G   0% /dev/shm

[root@ ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          3824       3209        615          0        146       2390
-/+ buffers/cache:        671       3153
Swap:         1999          0       1999

[root ~]# nproc
4

Below are the largest tables on the database server: 以下是数据库服务器上最大的表:

数据库服务器中最大的表

Question : With the provided info, what would be the best variables settings for: 问题 :使用提供的信息,什么是最佳变量设置:

   innodb_buffer_pool_size
    innodb_log_buffer_size
    innodb_log_file_size
    innodb_flush_log_at_trx_commit
    innodb_lock_wait_timeout:
    innodb_doublewrite
    innodb_thread_concurrency
    innodb_read_io_threads
    innodb_write_io_threads
    innodb_concurrency_tickets
    innodb_adaptive_max_sleep_delay
    innodb_commit_concurrency
    innodb_read_ahead_threshold

innodb_buffer_pool_size innodb_buffer_pool_size

If possible: a bit larger than all tablespace files combined 如果可能:比所有表空间文件的总和大一点

If that isn't possible: as large as you can make it 如果那不可能:尽你所能

Buffer pool hit rate in SHOW ENGINE INNODB STATUS will provide hints whether buffer pool size is a potential bottleneck SHOW ENGINE INNODB STATUS中的缓冲池命中率将提示缓冲池大小是否是潜在的瓶颈

innodb_log_buffer_size innodb_log_buffer_size

if you can afford it: up to innodb_log_file_size 如果您负担得起:最多innodb_log_file_size

innodb_log_file_size innodb_log_file_size

At least 10 times the size of the largest transaction you're expecting to handle 至少是您要处理的最大交易的10倍

innodb_flush_log_at_trx_commit 的innodb_flush_log_at_trx_commit

If you care about your data you want to have this active, if you can live with loosing some transactions on mysqld or system failure you may use one of the "only once per second" settings ... 如果您关心自己的数据,则希望使其处于活动状态,如果您可以忍受mysqld上的某些事务丢失或系统故障,则可以使用“每秒仅一次”设置之一...

innodb_lock_wait_timeout innodb_lock_wait_timeout

This totally depends on your applications needs, eg how long stalling while waiting for a row lock to be granted is acceptable 这完全取决于您的应用程序需求,例如,等待授予行锁时停顿多长时间是可以接受的

innodb_doublewrite innodb_doublewrite

If you care about data integrity you definitely want to have this active, unless you are on a file system that has a similar feature internally (ZFS, btrfs do as far as I can tell, others not so much) 如果您关心数据的完整性,则肯定要启用此功能,除非您使用的是内部具有类似功能的文件系统(据我所知,ZFS,btrfs的作用不大,其他的则不多)

innodb_thread_concurrency innodb_read_io_threads innodb_write_io_threads innodb_concurrency_tickets innodb_adaptive_max_sleep_delay innodb_commit_concurrency innodb_read_ahead_threshold innodb_thread_concurrency innodb_read_io_threads innodb_write_io_threads innodb_concurrency_tickets innodb_adaptive_max_sleep_delay innodb_commit_concurrency innodb_read_ahead_threshold

totally depends on your actual workload, defaults should usually be fine though 完全取决于您的实际工作量,尽管默认情况下通常应该可以

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM