# Updated replication for CHT v5.0 ~ Replication Cinque

**URL:** <https://forum.communityhealthtoolkit.org/t/updated-replication-for-cht-v5-0-replication-cinque/5397>\
**Category:** Development\
**Created:** [October 7, 2025, 2:57pm UTC](https://forum.communityhealthtoolkit.org/t/updated-replication-for-cht-v5-0-replication-cinque/5397 "2025-10-07T14:57:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![mrjones](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrjones/32/681_2.png) [@mrjones](https://forum.communityhealthtoolkit.org/u/mrjones)\
**Post date:** [October 14, 2025, 10:44pm UTC](https://forum.communityhealthtoolkit.org/t/updated-replication-for-cht-v5-0-replication-cinque/5397/3 "2025-10-14T22:44:50Z")

</div>

@diana - I have 5 test users on my cloned production instance with anywhere from 5k to 200k documents each. I’ve written a test script to query the `/api/v1/initial-replication/get-ids` API 5 times for each user. We can then average together the times. The users on the cloned instance have had their passwords reset to be all the same [using](https://forum.communityhealthtoolkit.org/t/high-load-slow-response-when-changing-password-for-user-with-a-lot-of-documents/5407/2) `curl`.

I’ll record a CSV of the results for `4.21` and then re-run script after we upgrade to `cinque` version. Here’s an example of what data will look like:

```csv
user docs seconds cht-version
foo 232021 3434.23 4.21
smang 12002 423.01 4.21

```

And here’s the python script I’m using:

```python
import time
import subprocess
import requests
import os

def run_command(command):
    proc = subprocess.Popen(
        command,
        shell=True,
        executable="/bin/bash",
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE
    )
    return proc.communicate()

def check_docs(user, type):
    start_time = time.time()
    password = 'SHARED-PASSWORD-HERE'
    api = '/api/v1/initial-replication/get-ids'
    full_url = f"https://{user}:{password}@lumbini-cinque-test.dev.medicmobile.org{api}"
    command = f"curl -qs '{full_url}' | jq -r '.doc_ids_revs | length'"
    try:
        doc_count, err = run_command(command)
    except Exception as e:
        print(f"FAIL: {user} doc count couldn't be fetched. Error: ({e})")
        return False

    if not isinstance(int(doc_count.decode().strip()), int):
        print(f"FAIL: {user} doc count isn't an integer, got: {err}")
        return False

    try:
        end_time = time.time()
        total_time = end_time - start_time
        print(f"{user},{int(doc_count.decode().strip())},{round(total_time,4)},{type}")
    except Exception as e:
        print(f"FAIL: {user} couldn't output results. Error: ({e})")
        return False

num = 5
for _ in range(num):
    check_docs('foo',"4.21")
    check_docs('bar',"4.21")
    check_docs('bash',"4.21")
    check_docs('quuux',"4.21")
    check_docs('smang',"4.21")

```

cc @binod

---

_[View the full topic](https://forum.communityhealthtoolkit.org/t/updated-replication-for-cht-v5-0-replication-cinque/5397)._
