nickva edited a comment on pull request #3364:
URL: https://github.com/apache/couchdb/pull/3364#issuecomment-782437514


   To help test the PR I created a silly script which runs with a local 
`./dev/run -n1` cluster. It configures replication jobs and shares for three 
`_replicator` dbs and then continuously samples the proportion of running jobs 
in each db:
   
   https://gist.github.com/nickva/7e86b3df19537a60372217e0f68b693a
   
   So for the default parameters it might output something like:
   
   ```
    ** run stats num dbs: 3, total jobs: 100
   rdb1/_replicator 66 66%
   rdb2/_replicator 23 23%
   rdb3/_replicator 11 11%
   
    ** run stats num dbs: 3, total jobs: 100
   rdb1/_replicator 61 61%
   rdb2/_replicator 31 31%
   rdb3/_replicator 8 8%
   ```
   
   With a configuration where the shares are all even (100) but the dbs have an 
uneven number of jobs, after 5-10 minutes there should be a roughly even share 
of running jobs from each db, even though one db has 500 jobs and others have 
less.
   ```python
   INTERVAL = 20000
   CONFIG = {
       "replicator": {
           "max_jobs": "100",
           "max_churn": "20",
           "interval" : str(INTERVAL),
       },
       "replicator.shares": {
           RDB1 : "100",
           RDB2 : "100",
           RDB3 : "100",
       }
   }
   REPS = {
       RDB1 : 200,
       RDB2 : 300,
       RDB3 : 500,
   }
   ```
   
   ```
    ** run stats num dbs: 3, total jobs: 100
   rdb1/_replicator 30 30%
   rdb2/_replicator 34 34%
   rdb3/_replicator 36 36%
   
    ** run stats num dbs: 3, total jobs: 100
   rdb1/_replicator 29 29%
   rdb2/_replicator 33 33%
   rdb3/_replicator 38 38%
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to