5 ms·
Ask HN: How big should be timeout for checking via HTTP if site is up?
I'm working on uptime monitoring service and I naively thought that 10 seconds should be enough for checking if the site is up.
I check if site is up via 5 nodes, and each node makes 3 tries of HTTP requests with 10 secs timeout.
So,
5 nodes. 3 tries. 10 seconds timeout.
But I've just found out that it's way too small. So I'm going to change the timeout to 30 seconds.
But maybe I'm wrong again, so what would you recommend as a proper timeout?
HTTP requests are done with curl.
- aww_dang 6y agoUser configurable would be best. 10 seconds seems excessive for most sites. If their app requires a longer timeout, I doubt they are in the majority. Even so, 10 seconds to complete a request would indicate a problem that I would want to be made aware of.
- Akcium 6y agoI made it configurable, but seems like most services have quite a long timeout: 30-120 seconds. You know it happens that a user adds 10 sites, one of them is slow and he complains that I send false alarms :) Thank you!
- aww_dang 6y agomaybe add a health meter for response time?
- Akcium 6y agoWhat do you mean? If it's a thing for checking performance, like "your site is up but very slow", I have lighthouse checks as well, plus I write response time to database. Just took a look at the site which had troubles, it has 2-3 seconds response time. But this is only for getting first host, not js/css resources etc. So probably indeed sometimes it takes more than 10 seconds to get response...
- aww_dang 6y agoIf the site is up and you send them an alert saying it is down, that's a bad UX. If the site is slow you can send a different alert. From that screen they can be prompted to configure settings, disable the alert, set timings, et cetera. 2-3 seconds to receive headers is excessive. Anything over 1 second needs improvement. Realistically Googlebot isn't going to crawl much if it takes more than 500ms.
- Akcium 6y agoI see. This is what I use lighthouse audits for, plus I'll have different alerts which user can enable for slow sites, like "If response time > 2 seconds trigger an alarm". So 1. By default I'll setup timeout to be 30 seconds, which will be customazible. Maybe 30 secs max. 2. Add ability to setup alarms for slow response time Cool!
- deleted 6y ago[deleted]