Change the config to use a lsm tree rather than btree for tables.

Stop using direct_io as it forces operations to sync more often, slowing
things down, at the expense of double-buffering (this will use more RAM).
This commit is contained in:
Gregory Burd 2013-03-08 13:33:12 -05:00
parent 3cff357e49
commit 57917f8bc6

View file

@ -103,25 +103,25 @@ start(Partition, Config) ->
{create, true}, {create, true},
{logging, true}, {logging, true},
{transactional, true}, {transactional, true},
{direct_io, ["data", "log"]},
{session_max, 128}, {session_max, 128},
{cache_size, "2GB"}, {cache_size, "2GB"},
{sync, false}, {sync, false}
{verbose, %% {verbose,
["block", "shared_cache", "ckpt", "evict", %% ["block", "shared_cache", "ckpt", "evict",
"evictserver", "fileops", "hazard", "lsm", %% "evictserver", "fileops", "hazard", "lsm",
"mutex", "read", "readserver", "reconcile", %% "mutex", "read", "readserver", "reconcile",
"salvage", "verify", "write"]}], %% "salvage", "verify", "write"]}
],
case wterl_conn:open(DataRoot, ConnectionOpts) of case wterl_conn:open(DataRoot, ConnectionOpts) of
{ok, ConnRef} -> {ok, ConnRef} ->
Table = "table:wt" ++ integer_to_list(Partition), Table = "lsm:wt" ++ integer_to_list(Partition),
SessionOpenOpts = [{isolation, "snapshot"}], SessionOpenOpts = [{isolation, "snapshot"}],
{ok, SRef} = wterl:session_open(ConnRef, wterl:config_to_bin(SessionOpenOpts)), {ok, SRef} = wterl:session_open(ConnRef, wterl:config_to_bin(SessionOpenOpts)),
SessionOpts = [%TODO {block_compressor, "snappy"}, SessionOpts = [%TODO {block_compressor, "snappy"},
{internal_page_max, "128K"}, {internal_page_max, "128K"},
{leaf_page_max, "128K"}, {leaf_page_max, "256K"},
{lsm_chunk_size, "200MB"}, {lsm_chunk_size, "256MB"},
{lsm_bloom_config, [{leaf_page_max, "10MB"}]} ], {lsm_bloom_config, [{leaf_page_max, "16MB"}]} ],
ok = wterl:session_create(SRef, Table, wterl:config_to_bin(SessionOpts)), ok = wterl:session_create(SRef, Table, wterl:config_to_bin(SessionOpts)),
{ok, #state{conn=ConnRef, {ok, #state{conn=ConnRef,
table=Table, table=Table,