avniproject / avni-server

Backend APIs for Avni
https://avniproject.org
GNU Affero General Public License v3.0
7 stars 25 forks source link

Get of encounters - external API is very slow #702

Closed mahalakshme closed 4 months ago

mahalakshme commented 6 months ago

Issue:

On doing the below:

zgrep '/api/encounters' chs.log.2024-03-14.*
zgrep '/api/encounters' chs.log.2024-03-13.*

found the below logs: taking 2 mins when page number is higher:

Image

Lesser time when page no is lower:

Screenshot 2024-03-18 at 12 12 26 PM

But unable to reproduce the issue via POSTman: taking less than 40 secs even when page no is higher Image

AC:

petmongrels commented 6 months ago

notes

To try

notes after code change

response times comparison

https://docs.google.com/spreadsheets/d/1B9gChZnzRkhJhxRurcO-111FKYrs2Ax7A9GMGS2r-O4/edit#gid=0

AchalaBelokar commented 5 months ago
petmongrels commented 4 months ago

There have no requests from Niti in last month. Checked for other organisations like RWB which was ok. but is not comparable.