When programmatically issuing HTTP POST requests, what timeout values would be sensible?
In my case, I'm looking to set 'sensible' timeout values when making POST requests in PHP, however this applies to any language.
I need to be able to issue a set of requests, each to a user-specified URL. If I do need to process requests consecutively instead of concurrently, I'd like to specify a sensible time beyond which a request is deemed to have timed out.
PHP's default socket timeout is 60 seconds. This seems an unnecessarily long time to wait before deciding a request is not going to be completed.
As these are POST requests they should complete quickly - there's no data to be retrieved and returned as with a GET request.
We should be able to assume, most of the time, that the failure to issue a response to a request within X seconds means the host is unlikely to issue a response within a reasonable time for values of X significantly less than 60.
Surely hosts rarely take more than 60 seconds to respond to a simple POST request. Do they even rarely take more than 10 seconds? 5 seconds?
What might be sensible values for X in practice? Justifications accompanying suggestions would be extremely beneficial.