fix(replication): Performance drop following v2.2.0
fix(replication): Performance drop following v2.2.0

Following commit [`feat(replication): Implement queues and replication
controller`], with a `MAX_NUMBER_OF_WORKERS = 64` configuration, performance
have dropped.
It is said in the commit that the script will take ~15% more time.
But, in production, with ~70k small dbs, we see a worse increase of ~26%.

Re-doing the test of [`feat(replication): Implement queues and replication
controller`], I see that part of the drop is due to
`ideal_number_of_replications()` computation, and part is not explained yet.

For that first part, the issue seems to be the use of shared
`multiprocessing.Manager().list()` arrays between process.
[It's something that is not recommended in the documentation], the recommended
way is to use `multiprocessing.Queues`, and it helps indeed recover part of the
performance lost (3000 small dbs):
- v2.1.6:
  - 28,26s user 6,72s system 23% cpu 2:26,89 total
  - 27,87s user 6,67s system 23% cpu 2:26,45 total
- this PR*:
  - 20,33s user 3,63s system 14% cpu 2:50,55 total
  - 20,09s user 3,69s system 14% cpu 2:47,32 total
- v2.2.1*:
  - 61,94s user 18,05s system 40% cpu 3:19,44 total
  - 61,81s user 17,80s system 39% cpu 3:21,01 total

*For this PR and v2.2.1 tests the following patch is used so results can be
compared to v2.1.6:
```diff
--- a/coucharchive
+++ b/coucharchive
@@ -34,7 +34,7 @@ import urllib.request
 import couchdb

-MAX_NUMBER_OF_WORKERS = 128
+MAX_NUMBER_OF_WORKERS = 64

 def _canonical_couchdb_url(url):
@@ -296,7 +296,7 @@ class ReplicationControl(object):
         if not len(self._last_successes):
             # We do not have enough data yet to return anything useful.
             # Start with 4 concurrent replications:
-            return 4
+            return 64
         else:
             # Compute the ideal number of concurrent replications, to finish in
             # ideal_duration:
```

[It's something that is not recommended in the documentation]: https://docs.python.org/fr/3/library/multiprocessing.html#sharing-state-between-processes
[`feat(replication): Implement queues and replication controller`]: https://github.com/adrienverge/coucharchive/commit/45fbdd5

adrienverge/coucharchive