Improve performance on /samples
We saw on Friday 17th afternoon that retrieving the list of samples took > 20s
Currently, Saturday morning takes 2 seconds (20 samples):
https://icatplus.esrf.fr/catalogue/1cfdd5cb-0391-44f2-9876-42e976931153/samples?investigationId=1353253464&includeDatasets=false&sortBy=DATASET_DATE&sortOrder=-1&limit=20&skip=0
I would like to understand how beamline activity impacts the performance of the UI
Cache system
My dear ab
is giving strange results since Yesterday. Requests are extremely fast. It seems that a cache system has been enabled at some level. As we have not done it in ICAT or ICAT+ I presume it has been activated before (e.g:: nginx, proxy) or after (e.g: DB) ICAT
Same query takes 1.9s first time and 242ms the second time:
ab -n 1 "https://icatplus.esrf.fr/catalogue/1cfdd5cb-0391-44f2-9876-42e976931153/samples?investigationId=1353253880&includeDatasets=false&sortBy=DATASET_DATE&sortOrder=-1&limit=21&skip=0"
1st: Time per request: 1890.809 [ms] (mean, across all concurrent requests)
2nd: Time per request: 242.603 [ms] (mean, across all concurrent requests)
Easy to reproduce by change a parameter of the query (limit in this case):
ab -n 1 "https://icatplus.esrf.fr/catalogue/1cfdd5cb-0391-44f2-9876-42e976931153/samples?investigationId=1353253880&includeDatasets=false&sortBy=DATASET_DATE&sortOrder=-1&limit=19&skip=0"
1st: Time per request: 1940.275 [ms] (mean, across all concurrent requests)
2nd: Time per request: 244.165 [ms] (mean, across all concurrent requests)