adunkman / dc311rn.com

Quickly check the status of a DC 311 service request
https://www.dc311rn.com
MIT License
6 stars 0 forks source link

Timeout requests to DC’s 311 service. #15

Open adunkman opened 6 years ago

adunkman commented 6 years ago

As discovered through logs, DC’s 311 endpoint sometimes doesn’t return data for… 30+ seconds. This isn’t an ideal experience for our service (it looks like this app isn’t working well).

I’m not sure what the best thing to do would be — I can think of two solutions:

  1. Timeout after a certain amount of time, and show an error that says DC’s 311 service is too slow.

  2. Timeout after a certain amount of time, and show an error that says we’re still requesting data from DC’s 311 service, and then client-fetch the data.

adunkman commented 6 years ago

Looking at the data, requests that are triggering timeouts are almost always requests for individual service requests. There are 604 requests for service request numbers in the last 24 hours:

Response Time Number of Requests Percent of Requests
0-1s 576 95.4%
1-5s 6 1%
5-29s 10 1.7%
29-31s* 12 2%

* Heroku’s response timeout is 30 seconds (sometimes 30.001 seconds).