AudaciousInquiry / fhir-saner

Situation Awareness for Novel Epidemic Response (COVID-19 driven project to track resource availability)
17 stars 0 forks source link

Recommend the number of entries that servers return by default before paging #84

Closed michaeldonnelly closed 4 years ago

michaeldonnelly commented 4 years ago

A large bundle of MeasureReports can be large and can take a long time to load. (1000 MeasureReports from our system is ~5MB and takes around 30 seconds.) Clients can control this with the _count search parameter, but many don't know that.

Potential issues

Should we have a recommended default for how many entries servers return if the client doesn't specify a _count?

michaeldonnelly commented 4 years ago

Here are some examples of how long it takes and how big it is.

Entries Response Time (seconds) Size (MB)
10 0.48 0.05
50 1.70 0.27
100 3.73 0.53
200 7.21 1.04
250 8.05 1.30
500 16.15 2.60
1000 33.63 5.19

All of these searches start at the same point and are for warm data.

michaeldonnelly commented 4 years ago

Other systems may be different, but at least with Epic's, the response time and size scale linearly. (Except for the first sample above; anything with more than that, the overhead vanishes into the cost per MeasureReport.)

keithboone commented 4 years ago

I generally set default count values for clinical information systems to around 20 (maybe higher for labs). The place to set is for back end is probably in the 3-10 second range for a request, and I'd look closer to 3-5 b/c of intermediaries adding time. So may 100.

michaeldonnelly commented 4 years ago

3 -5 second response time sounds like a reasonable bar. Assuming a Measure that's reported on daily, 100 entries would get:

And that'd just be a default. There's nothing to stop the server from allowing the client to specify a higher _count than the default.

michaeldonnelly commented 4 years ago

Does anyone have examples where 100 entries would take more than 5 seconds? What about examples where you could get significantly more than 100 entries in 3 seconds?