xref: /curl/docs/cmdline-opts/keepalive-time.md (revision 2abfc759)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: keepalive-time
5Arg: <seconds>
6Help: Interval time for keepalive probes
7Added: 7.18.0
8Category: connection timeout
9Multi: single
10See-also:
11  - no-keepalive
12  - keepalive-cnt
13  - max-time
14Example:
15  - --keepalive-time 20 $URL
16---
17
18# `--keepalive-time`
19
20Set the time a connection needs to remain idle before sending keepalive probes
21and the time between individual keepalive probes. It is currently effective on
22operating systems offering the `TCP_KEEPIDLE` and `TCP_KEEPINTVL` socket
23options (meaning Linux, *BSD/macOS, Windows, Solaris, and recent AIX, HP-UX and more).
24Keepalive is used by the TCP stack to detect broken networks on idle connections.
25The number of missed keepalive probes before declaring the connection down is OS
26dependent and is commonly 8 (*BSD/macOS/AIX), 9 (Linux/AIX) or 5/10 (Windows), and
27this number can be changed by specifying the curl option `keepalive-cnt`.
28Note that this option has no effect if --no-keepalive is used.
29
30If unspecified, the option defaults to 60 seconds.
31