Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Innostore is a simple Erlang API to Embedded InnoDB.

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 c_src
Octocat-spinner-32 ebin
Octocat-spinner-32 src
Octocat-spinner-32 .hgignore
Octocat-spinner-32 .hgtags
Octocat-spinner-32 LICENSE GPLv2 January 24, 2010
Octocat-spinner-32 Makefile
Octocat-spinner-32 README
Octocat-spinner-32 rebar
Octocat-spinner-32 rebar.config
README
README
======

Innostore is a simple Erlang API to Embedded InnoDB.

Innostore does not attempt to provide the same API as Inno itself, but instead
provides a simpler interface which is sufficient for many uses.  This interface
is exported by the "innostore" module of the "innostore" application.

An example of use of that interface can be found in the "innostore_riak" module,
which is a valid Riak backend module using innostore for storage.

Installation
------------
* Download or clone the innostore project from http://hg.basho.com/innostore.

* In the innostore directory, build it:
  $ make

* Option 1: Install innostore into your Erlang distribution:
  $ make install

* Option 2: Install innostore into an existing Riak build:

  ** Create an "innostore" directory in the riak/lib directory
  $ mkdir -p riak/lib/innostore

  ** Copy the innostore ebin and priv directories into riak/lib/innostore
  $ cp -R innostore/ebin innostore/priv riak/lib/innostore

  ** Finally, configure riak to use innostore in app.config by setting
     the storage_backend. Change riak/etc/app.config:

     {storage_backend, innostore_riak}

  ** You may wish to also tune the innostore engine. Add a innostore
     application section to the riak/etc/app.config file:

     %% Inno db config
     {innostore, [
                  {data_home_dir,            "/mnt/innodb"},
                  {log_group_home_dir,       "/mnt/innodb"},
                  {buffer_pool_size,         2147483648}, %% 2G of buffer
                  {thread_concurrency,       0},
                  {flush_log_at_trx_commit,  2},
                  {max_dirty_pages_pct,      75},
                  {thread_sleep_delay,       10}
                 ]}


Tuning
------

While InnoDB can be extremely fast for a durable store, its performance is
highly dependent on tuning the configuration to match the hardware and
dataset. All the configuration is available as application variables in the
innostore applications cope. An example configuration follows:

%% InnoDB config
{innostore, [
             {data_home_dir,            "/innodb"},     %% Where data files go
             {log_group_home_dir,       "/innodb-log"}, %% Where log files go
             {buffer_pool_size,         2147483648},    %% 2G in-memory buffer in bytes
             {thread_concurrency,       0},             %% Permit any # of threads in inno DB runtime at once
             {flush_log_at_trx_commit,  0},             %% Flush pending log commits once per second
             {max_dirty_pages_pct,      75},            %% Reduce frequency at which dirty pages are flushed
             {thread_sleep_delay,       10}             %% Reduce penalty for attempting to grab lock
             {log_buffer_size,          8388608},       %% Don't change this
             {log_files_in_group,       6},             %% How many files you need -- usually, 3 < x < 6
             {log_file_size,            134217728}      %% No bigger than 256MB
            ]},

In general, only the first three parameters (data_home_dir, log_group_home_dir
and buffer_pool_size) will need to be changed. It is strongly recommended that
the data home dir and log home dir are kept on separate spindles/drives.

The data_home_dir and log_group_home_dir MUST exist before starting innostore.

The buffer_pool_size determines how much data Inno tries to keep in memory at
once. Obviously, the more of your dataset that can fit in RAM, the better Inno
will perform. If you are running a 64-bit Erlang VM, the buffer_pool_size can
safely be set above 2G.

Make sure to set noatime on any disk involved with Inno, particularly if you are
expecting significant load.

When running innostore on solaris+zfs, make sure to set the recordsize=16k on
the pool where data_home_dir lives (prior to starting innostore). You may also
find that setting primarycache=metadata will positively influence performance.

Something went wrong with that request. Please try again.