3 ms·
In the case of curl, there is a timeout parameter for requests and connections etc. It's what i'd use for checking for a server being up. But in the general ca
by chii 1y ago
In the case of curl, there is a timeout parameter for requests and connections etc. It's what i'd use for checking for a server being up.
But in the general case, where the command being invoked does not have such an option, then it does make a lot of sense to do a check like that via the `timeout` utility.
- diggan 1y agoFor curl: --connect-timeout = Times out if the connection wasn't established within N seconds --max-time = Times out if the entire request wasn't completed within N seconds But then I don't remember if connect-timeout takes DNS lookups into account, or TLS handshakes. I seem to remember there is another sort of timeout that tends to be hard to get right when the connections are flaky/drops a lot of packets, so you end up having to wrap curl anyways if you want a hard limit on the timeout.
- SoftTalker 1y agoI've had many, many cases of processes in Linux getting wedged up bad enough that they cannot be killed. Usually this seems to involve them waiting on I/O.
- chgs 1y agoKill -9 won’t help in those cases though