Skip to content
Browse files

MB-7406: Add updater barrier for spatial indexer

Currently there's one spatial indexer for every vBucket,
hence a lot of updaters are running at the same time.
This commit adds a barrier, so that you can set the
maximum number of updaters that should run at the same
time. The default value is 4. The MapReduce indexer
already uses such a barrier.

Those two commits should me merged at the same time:
http://review.couchbase.org/24830
http://review.couchbase.org/24831

Change-Id: Ie1e2a5b2f50cfa1137ec24ed414e9d8a4adac4d2
Reviewed-on: http://review.couchbase.org/24830
Tested-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
  • Loading branch information...
1 parent fd661bf commit fb6316e699cc177a6d78fde20958a406f4d21ed3 @vmx vmx committed with fdmanana Dec 17, 2012
Showing with 7 additions and 0 deletions.
  1. +1 −0 etc/couchdb/default.ini.tpl.in
  2. +6 −0 src/couchdb/couch_primary_sup.erl
View
1 etc/couchdb/default.ini.tpl.in
@@ -20,6 +20,7 @@ file_compression = snappy
; Maximum number of distinct view update/building processes at any point in time.
max_parallel_indexers = 4
max_parallel_replica_indexers = 2
+max_parallel_spatial_indexers = 4
; BTree Implmentation to use (native or erlang)
btree_implementation = native
consistency_check_precompacted = false
View
6 src/couchdb/couch_primary_sup.erl
@@ -84,6 +84,12 @@ init([]) ->
permanent,
brutal_kill,
worker,
+ [couch_index_barrier]},
+ {couch_spatial_index_barrier,
+ {couch_index_barrier, start_link, [couch_spatial_index_barrier, "max_parallel_spatial_indexers"]},
+ permanent,
+ brutal_kill,
+ worker,
[couch_index_barrier]}
],
{ok, {{one_for_one, 10, 3600}, Children}}.

0 comments on commit fb6316e

Please sign in to comment.
Something went wrong with that request. Please try again.