MySQL and InnoDB comments…

Hello everyone, here we go for a new blog post and now treating about InnoDB inside MySQL 5.5 and as you should now, this new version uses InnoDB Plugin version 1.1 which one has a lot of new adjustable resources. What most caught my attention was the impressed way that users could adjust it to have a lot more performance than MyISAM, for example. It was benchmarked here.

At the beginning, when Oracle announced about the new default Storage Engine (InnoDB, bingo!), many users were scared and started to ask about why is that change really necessary. Many other users just nod heads for it and now we have a good proof of this necessity – to have more scale, security and reliability.

Scale [Up] because the data could be compressed to use more memory and processor than disk (it avoid overhead), more transactions could be started concurrently and more CPU cores can be addressed as MySQL 5.5.4 is better prepared now to scale up to 32 cores. You can read about it accessing DimitriK’s (dim) Weblog.

innodb_more_cores

MySQL 5.5 and InnoDB Plugin 1.1 is reaching higher TPS levels than others

Security is noted when you compare InnoDB with MyISAM because with InnoDB you will have good performance with safe and crash recovery, using transactions logs and data and indexes inside a tablespace, what will improve besides security, availability too.

I remember you to use new file format (innodb_file_format) configured as Barracuda in order to provide all new functionality to your environment. Unlike MyISAM, InnoDB has its own transactions logs which by default is created inside DATADIR (normally at /var/lib/mysql) in order to maintain internal registers about transactions that came into the InnoDB Kernel – i.e., started transactions (If you specify no InnoDB configuration options, an auto-extending 10MB datafile named `ibdata1'and two 5MB log files named `ib_logfile0' and `ib_logfile1' in the MySQL data directory – DATADIR). Receiving the logs that COMMIT or ROLLBACK, a checkpoint is done and the life going on.

You can use the following variables to handle InnoDB Transaction Log behavior:

[mysqld]

# innodb file new features configuration
innodb_file_per_table = BARRACUDA # it will "turn on" all InnoDB Plugin new features
innodb_file_per_table = 1 # it will "turn on" a tablespace file per database table

# innodb log file configuration
innodb_log_group_home_dir=/var/log/mysql/innodb # where files will end up
innodb_log_files_in_group=8 # the amount of log files current instance will count with
innodb_log_file_size=512M # the total of innodb_files_in_group * innodb_log_file_size can't be more than 4096M - 4G

# innodb log buffer configuration - tinkling about a circle per created log file before flushing process
innodb_log_buffer_size=1024M # considering an environments with large transactions, making this variable large will save disk I/O, click here to know more how to calculate it better
innodb_flush_method=O_DIRECT # avoid OS Buffer Cache and too much RAM dedicated to it
#

Reliability cause these all features together will delivery good set of subsystems that will work to have good performance, what can be achieved using innodb_file_per_table to create a tablespace file per table, less I/O will be performed, the capacity to compress data using less space into tablespace segments, expends less extents.

A good touch, on broad terms is that InnoDB can be configured to use external disks as SAN or other machines to storage its structure and data. Using certain variables you can, for example, put InnoDB files on another disks to get more performance. These below variables will become it possible:

[mysqld]
innodb_data_home_dir  = /nfs1/innodb
innodb_data_file_path = /ibdata/ibdata1:50M;/ibdata/ibdata2:50M:autoextend

, , , ,

  1. #1 by Wagner Bianchi on julho 16, 2011 - 4:47 pm

    After to add innodb_file_format on the my.cnf or your own created MySQL configuration file as…

    [mysqld]
    innodb_file_per_table = 1
    innodb_file_format=barracuda
    #

    .. you will be able to use compressed InnoDB tables to avoid disk reads (overhaed)…

    CREATE TABLE test.t1 (id int) ROW_FORMAT=COMPRESSED ENGINE=INNODB;

    Cheers,

Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Sair / Alterar )

Imagem do Twitter

You are commenting using your Twitter account. Sair / Alterar )

Foto do Facebook

You are commenting using your Facebook account. Sair / Alterar )

Connecting to %s

Seguir

Obtenha todo post novo entregue na sua caixa de entrada.