CHT app slowing down

We are running an instance of 4.x and using Samsung A7 Lite tablets to see clients. We have noted that the performance of the app on health worker tablets has degraded quickly over a month or two. This as the number of documents has increased. We started with ~700 documents and now we have ~10k.

CHT specs:
Version: 4.x

Device specs:

Additional details:

  • avg load time is 7+ seconds on the tablets
  • the app has ~10k documents at the moment
  • the app is slow when loading health centers, reports tab, tasks tab and initializing
  • we tried running the app on higher end devices like an Xiaomi Redmi Note 10T, iPhone 14, MacBook, mid 2010s desktop and the performance problems varied from improved to completely disappeared

Nice to have:

  • low cost solution
1 Like

Hi @danielmwakanema

It’s expected for the number of documents to affect device performance.
Loading times vary depending on many factors, including battery levels, how many other apps are running on the same device, etc.
We store loading time statistics in telemetry docs: User telemetry | Community Health Toolkit

Im curious if you’re noticing the same performance across-the-board or noticing differences depending on how long the app was running for example.

It would be useful if you could inspect telemetry and share some numbers with us.

Thank you!

1 Like

Hello @diana, we have noticed the performance drop across-the-board.

Alright, I will have a look at the telemetry data. I see I can find this metadata in CouchDB. Is this data also available/visualized in Watchdog or something similar?

Hi @danielmwakanema

I believe this is only available in CouchDb out of the box. I’m not entirely sure if we ship any prebuilt queries to postgres. Maybe @binod can help there?

Alright, thanks. Those would be a nice-to-have.

Do you have Couch2PG set up?

It will make it easier to query the telemetry and feedback docs in PostgreSQL once it is set up and data synced.

1 Like

Hello @binod, yes we do have Couch2pg setup, :).

In that case, you can have a look at the telemetry and feedback data from these materialized views:

  • useview_telemetry
  • useview_telemetry_devices
  • useview_telemetry_metrics
  • useview_feedback

Here are some forum posts with SQL query examples that you might find helpful:

I met with the team today to discuss these client-side challenges.

Proposed Mitigation This project already has a few cron tasks to support an integration with OpenMRS. These tasks maintain a summary of data per patient by inspecting the CHT reports and combining it with data from OpenMRS. Our plan to solve client-side scaling challenges is to extend this task further so it stores all relevant information needed for the CHT app & this would allow us to purge all other CHT reports for all users.

Scale-up There are about 2500 contacts and 8000 reports on these slow devices today. This is about 40% of the contacts required to scale to support their largest health center + 15% of these contacts have reports today.

At scale + after this mitigation there will be ~5500 contacts and ~5500 reports (1 summary report per contact + all other reports purged). That is 11k docs/device which is where we are at today. Performance is satisfactory on desktops, iPhones, iPads (etc) but unsatisfacty on the production hardware. Our recommendation is that this project procure faster devices (at least for nurses working in the largest facilities). Our Nepal team recently went through a similar experience procuring new devices for users, so I’m going to consult with them before we share device recommendations.

This may prove to be an important client-side performance bug affecting tab load times - espectially since this project has so many contacts. It affects 3.17.1 which is the production version for this app. Low performance in Reports tab · Issue #8576 · medic/cht-core · GitHub