Permalink
Browse files

Added the new replicator implementation

Closes COUCHDB-1024. An introduction to this new implementation was given
in the development mailing list:  http://s.apache.org/KsY



git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1071375 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
fdmanana committed Feb 16, 2011
1 parent 82747ec commit 34eb4175f8547546cd76fbeb006421020cbf0d71
Showing with 5,074 additions and 4,140 deletions.
  1. +22 −3 etc/couchdb/default.ini.tpl.in
  2. +1,254 −578 share/www/script/test/replication.js
  3. +27 −21 src/couchdb/Makefile.am
  4. +714 −0 src/couchdb/couch_api_wrap.erl
  5. +37 −0 src/couchdb/couch_api_wrap.hrl
  6. +308 −0 src/couchdb/couch_api_wrap_httpc.erl
  7. +3 −21 src/couchdb/couch_db.hrl
  8. +1 −0 src/couchdb/couch_doc.erl
  9. +165 −0 src/couchdb/couch_httpc_pool.erl
  10. +1 −31 src/couchdb/couch_httpd_misc_handlers.erl
  11. +50 −0 src/couchdb/couch_httpd_replicator.erl
  12. +6 −0 src/couchdb/couch_primary_sup.erl
  13. +0 −959 src/couchdb/couch_rep.erl
  14. +0 −119 src/couchdb/couch_rep_att.erl
  15. +0 −499 src/couchdb/couch_rep_changes_feed.erl
  16. +37 −36 src/couchdb/couch_rep_db_listener.erl
  17. +0 −311 src/couchdb/couch_rep_httpc.erl
  18. +0 −198 src/couchdb/couch_rep_missing_revs.erl
  19. +0 −283 src/couchdb/couch_rep_reader.erl
  20. +0 −165 src/couchdb/couch_rep_writer.erl
  21. +57 −0 src/couchdb/couch_replication_notifier.erl
  22. +776 −0 src/couchdb/couch_replicator.erl
  23. +30 −0 src/couchdb/couch_replicator.hrl
  24. +483 −0 src/couchdb/couch_replicator_doc_copier.erl
  25. +88 −0 src/couchdb/couch_replicator_rev_finder.erl
  26. +382 −0 src/couchdb/couch_replicator_utils.erl
  27. +10 −3 src/couchdb/couch_work_queue.erl
  28. +432 −0 src/couchdb/json_stream_parse.erl
  29. +5 −2 test/etap/001-load.t
  30. +0 −132 test/etap/110-replication-httpc.t
  31. +0 −253 test/etap/111-replication-changes-feed.t
  32. +0 −207 test/etap/112-replication-missing-revs.t
  33. +0 −314 test/etap/113-replication-attachment-comp.t
  34. +184 −0 test/etap/190-json-stream-parse.t
  35. +2 −5 test/etap/Makefile.am
@@ -71,7 +71,7 @@ _utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "%localdatadir%/www"}
_all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req}
_active_tasks = {couch_httpd_misc_handlers, handle_task_status_req}
_config = {couch_httpd_misc_handlers, handle_config_req}
-_replicate = {couch_httpd_misc_handlers, handle_replicate_req}
+_replicate = {couch_httpd_replicator, handle_req}
_uuids = {couch_httpd_misc_handlers, handle_uuids_req}
_restart = {couch_httpd_misc_handlers, handle_restart_req}
_stats = {couch_httpd_stats_handlers, handle_stats_req}
@@ -137,8 +137,27 @@ compressible_types = text/*, application/javascript, application/json, applicati
[replicator]
db = _replicator
max_replication_retry_count = 10
-max_http_sessions = 20
-max_http_pipeline_size = 50
+; More worker processes can give higher network throughput but can also
+; imply more disk and network IO.
+worker_processes = 4
+; With lower batch sizes checkpoints are done more frequently. Lower batch sizes
+; also reduce the total amount of used RAM memory.
+worker_batch_size = 1000
+; Maximum number of HTTP connections and pipeline size (for each connection)
+; per replication. These two settings have more impact on pull replications.
+http_connections = 20
+http_pipeline_size = 50
+; HTTP connection timeout per replication.
+; Even for very fast/reliable networks it might need to be increased if a remote
+; database is too busy.
+connection_timeout = 30000
+; Some socket options that might boost performance in some scenarios:
+; {nodelay, boolean()}
+; {sndbuf, integer()}
+; {recbuf, integer()}
+; {priority, integer()}
+; See the `inet` Erlang module's man page for the full list of options.
+socket_options = [{keepalive, true}, {nodelay, false}]
; set to true to validate peer certificates
verify_ssl_certificates = false
; file containing a list of peer trusted certificates (PEM format)
Oops, something went wrong.

0 comments on commit 34eb417

Please sign in to comment.