couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [14/32] git commit: updated refs/heads/1781-reorganize-and-improve-docs to 11fd32a
Date Fri, 14 Jun 2013 08:25:11 GMT
Describe compaction config section.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/dd5be912
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/dd5be912
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/dd5be912

Branch: refs/heads/1781-reorganize-and-improve-docs
Commit: dd5be912f898ae0c90b76d709dc58c4d912a4902
Parents: 50c4d85
Author: Alexander Shorin <kxepal@apache.org>
Authored: Tue Jun 11 21:03:18 2013 +0400
Committer: Alexander Shorin <kxepal@apache.org>
Committed: Wed Jun 12 16:06:22 2013 +0400

----------------------------------------------------------------------
 share/doc/build/Makefile.am         |   3 +
 share/doc/src/config/compaction.rst | 103 +++++++++++++++++++++++++++++++
 share/doc/src/config/daemons.rst    |   3 +-
 share/doc/src/config/index.rst      |   1 +
 4 files changed, 109 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/dd5be912/share/doc/build/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
index 6cb63eb..31581bc 100644
--- a/share/doc/build/Makefile.am
+++ b/share/doc/build/Makefile.am
@@ -55,6 +55,7 @@ html_files = \
     html/_sources/api/reference.txt \
     html/_sources/config/admins.txt \
     html/_sources/config/attachments.txt \
+    html/_sources/config/compaction.txt \
     html/_sources/config/cors.txt \
     html/_sources/config/couch-httpd-auth.txt \
     html/_sources/config/couchdb.txt \
@@ -113,6 +114,7 @@ html_files = \
     html/api/reference.html \
     html/config/admins.html \
     html/config/attachments.html \
+    html/config/compaction.html \
     html/config/cors.html \
     html/config/couch-httpd-auth.html \
     html/config/couchdb.html \
@@ -169,6 +171,7 @@ src_files = \
     ../src/api/reference.rst \
     ../src/config/admins.rst \
     ../src/config/attachments.rst \
+    ../src/config/compaction.rst \
     ../src/config/cors.rst \
     ../src/config/couch-httpd-auth.rst \
     ../src/config/couchdb.rst \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/dd5be912/share/doc/src/config/compaction.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/config/compaction.rst b/share/doc/src/config/compaction.rst
new file mode 100644
index 0000000..af377db
--- /dev/null
+++ b/share/doc/src/config/compaction.rst
@@ -0,0 +1,103 @@
+.. Licensed under the Apache License, Version 2.0 (the "License")you may not
+.. use this file except in compliance with the License. You may obtain a copy of
+.. the License at
+..
+..   http://www.apache.org/licenses/LICENSE-2.0
+..
+.. Unless required by applicable law or agreed to in writing, software
+.. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+.. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+.. License for the specific language governing permissions and limitations under
+.. the License.
+
+.. highlight:: ini
+
+.. _config/compaction:
+
+``[compaction]`` :: Compaction Daemon Rules
+===========================================
+
+List of compaction rules for the
+:ref:`compaction daemon <config/daemons/compaction_daemon>`.
+The daemon compacts databases and their respective view groups when all the
+condition parameters are satisfied. Configuration can be per database or
+global, and it has the following format::
+
+  [compaction]
+  database_name = [ {ParamName, ParamValue}, {ParamName, ParamValue}, ... ]
+  _default = [ {ParamName, ParamValue}, {ParamName, ParamValue}, ... ]
+
+
+For example::
+
+  [compaction]
+  _default = [{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "23:00"}, {to,
"04:00"}]
+
+Possible parameters:
+
+- ``db_fragmentation``: If the ratio (as an integer percentage), of the amount
+  of old data (and its supporting metadata) over the database file size is equal
+  to or greater then this value, this database compaction condition is
+  satisfied. This value is computed as::
+
+    (file_size - data_size) / file_size * 100
+
+  The data_size and file_size values can be obtained when
+  querying a :ref:`database's information URI <api/db.get>`.
+
+- ``view_fragmentation``: If the ratio (as an integer percentage), of the amount
+  of old data (and its supporting metadata) over the view index (view group)
+  file size is equal to or greater then this value, then this view index
+  compaction condition is satisfied. This value is computed as::
+
+    (file_size - data_size) / file_size * 100
+
+  The data_size and file_size values can be obtained when querying a
+  :ref:`view group's information URI <api/ddoc/info>`.
+
+- ``from`` and ``to``: The period for which a database (and its view groups)
+  compaction is allowed. The value for these parameters must obey the format::
+
+    HH:MM - HH:MM  (HH in [0..23], MM in [0..59])
+
+- ``strict_window``: If a compaction is still running after the end of the
+  allowed period, it will be canceled if this parameter is set to `true`.
+  It defaults to `false` and it's meaningful only if the *period* parameter is
+  also specified.
+
+- ``parallel_view_compaction``: If set to `true`, the database and its views are
+  compacted in parallel. This is only useful on certain setups, like for example
+  when the database and view index directories point to different disks.
+  It defaults to `false`.
+
+Before a compaction is triggered, an estimation of how much free disk space is
+needed is computed. This estimation corresponds to 2 times the data size of
+the database or view index. When there's not enough free disk space to compact
+a particular database or view index, a warning message is logged.
+
+Examples:
+
+#. ``[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}]``
+
+   The `foo` database is compacted if its fragmentation is 70% or more.
+   Any view index of this database is compacted only if its fragmentation
+   is 60% or more.
+
+#. ``[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "00:00"}, {to, "04:00"}]``
+
+   Similar to the preceding example but a compaction (database or view index)
+   is only triggered if the current time is between midnight and 4 AM.
+
+#. ``[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "00:00"}, {to, "04:00"},
{strict_window, true}]``
+
+   Similar to the preceding example - a compaction (database or view index)
+   is only triggered if the current time is between midnight and 4 AM. If at
+   4 AM the database or one of its views is still compacting, the compaction
+   process will be canceled.
+
+#. ``[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "00:00"}, {to, "04:00"},
{strict_window, true}, {parallel_view_compaction, true}]``
+
+   Similar to the preceding example, but a database and its views can be
+   compacted in parallel.
+
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/dd5be912/share/doc/src/config/daemons.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/config/daemons.rst b/share/doc/src/config/daemons.rst
index 2cfe4f7..9feb6f0 100644
--- a/share/doc/src/config/daemons.rst
+++ b/share/doc/src/config/daemons.rst
@@ -39,7 +39,8 @@ closing of the `_users` database for each request requiring authentication::
 ``compaction_daemon``
 ---------------------
 
-Automatic compaction daemon::
+Automatic compaction daemon. Could be configured with
+:ref:`compaction rules set <config/compaction>`::
 
   [daemons]
   compaction_daemon={couch_compaction_daemon, start_link, []}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/dd5be912/share/doc/src/config/index.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/config/index.rst b/share/doc/src/config/index.rst
index faf49a3..d592f0f 100644
--- a/share/doc/src/config/index.rst
+++ b/share/doc/src/config/index.rst
@@ -49,6 +49,7 @@ Content:
 
    admins
    attachments
+   compaction
    cors
    couch-httpd-auth
    couchdb


Mime
View raw message