On Wed, Oct 13, 2021 at 4:22 PM Usha Nayak <usha...@gmail.com> wrote:
>
> Need help in understanding the highlighted parameters:
>
> ProxyPass "/example" "http://backend.example.com";  timeout=3600 keepalive=On
>
> keepalive parameter - As I understand relates to TCP or socket keep alive 
> probes that are sent to prevent idle connection.
>
> My confusion is :
>
> Assuming the backend server takes 4 hrs to process a request and I have 
> 'keepalive on' in Apache httpd with the OS setting to send tcp probes every 2 
> minutes. Backend server and Apache httpd are sending TCP keep alive packets 
> to indicate the socket connection is not idle.
>
>  In this case, would the 'apache httpd' close the connection in 1 hr ( 
> timeout = 3600) because the 'apache httpd' didn't get the http data?

Yes, the timeout= parameter sets the inactivity timeout for the
backend connection. If reading from or writing to this connection
takes more time than the timeout= va
lue then the connection is forcibly closed and an error (504) is
returned to the client.

The keepalive= parameter is to enable the TCP keepalive mechanism on
the connection at the operating system level (SO_KEEPALIVE socket
option).
As you noted it consists of periodic TCP probes sent by the OS on the
connection to prevent intermediaries/routers/firewalls from closing it
due to their own TCP inactivity timeout, and also to detect whether
the peer is still connected (by acking the probes). The settings for
the probes period, ack timeout and number of retries happen at the OS
level for all the connections, that's why keepalive= is a simple
on/off.

Note that the ProxyPass keepalive= parameter must not be confused with
the "KeepAlive on/off" directive pertaining to the client connection.
The KeepAlive and KeepAliveTimeout directives are about the lifetime
of the client connection in between HTTP transactions. Once a request
has been handled and a response was sent to the client the
KeepAliveTimeout is the time to wait for the next request on the same
connection (if "KeepAlive off" the connection is closed immediately
and thus each connection handles a single request/response only).

FWIW, here is the correspondence between the client side and backend
side settings regarding timeout and keepalive:

Client side:              Proxy/Backend side:
  Timeout N           <=>   timeout=N
  KeepAlive On/Off    <=>   enablereuse=On/Off
  KeepAliveTimeout N  <=>   ttl=N
  [*Always On*]       <=>   keepalive=On/Off

Hope that helps..


Regards;
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to