HTTP header insertion on ACE timeout

Answered Question

Hi,


We're testing with http header insertion on our ACE-modules to log the client's ip-address.

I have made a webpage which displays the added header.


The insertion seems to work okay, but the header is only inserted in the first request within a one-minute period.

When I refresh the page within a minute, the header is not added.

When I wait a minute or longer before refreshing, the header is added.

When I open the page within a minute on a different machine, the header is added so it's obviously related to the user's session.


I can imagine this is done to reduce the ACE's workload, but is there some way to change this behaviour?

Correct Answer by Gilles Dufour about 7 years 7 months ago

switch/User1(config)# parameter-map type http Rebalance
switch/User1(config-parammap-http)# header ?
  modify  Modify header
switch/User1(config-parammap-http)# header modify ?
  per-request  This is applicable for every request/response
switch/User1(config-parammap-http)# header modify per-request


That's the paramter-map that you need to insert the header in every request.


The reason for the 1 minute is that your browser or your server keeps the connection open for that long.

If a new request (refresh) comes in during that period of time, we can reuse the existing connection.

ACE without the parameter-map does not add a new header.

After the 1 minute timeout (on the server or client - not ace) the connection is closed and when you do a refresh a new connection is open.

Since this is a new connection, ACE will insert the header.


The solution is the parameter-map above.


Gilles.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
ciscocsoc Tue, 12/01/2009 - 10:32
User Badges:
  • Silver, 250 points or more

Hi,


To change this behaviour you need to either enable "TCP server reuse" or "persistence-rebalance". This is documented in the ACE Server Loadbalancing manual under "Configuring HTTP Header Insertion". Admittedly this is a little subtle as the manual only mentions later (for example under TCP Server Reuse that "... Another effect of TCP server reuse is that header insertion and cookie insertion, if enabled, occur for every request instead of only the first request." - and similarly under persistence-rebalance.


HTH


Cathy

Okay, but where does the timeout of 1 minute in itself come from?

It could be that a user's session is balanced to another server, resulting in a new session and thus a new insertion, but we configured our serverfarms to use sticky sessions with a timeout of 15 minutes so that shouldn't be happening.


The fact that the insertion only works on the first request isn't our biggest problem, what bothers us more is that we're receiving complaints that customers on our websites lose their session after a minute of inactivity, resulting in an empty shopping basket, being logged out, etc.

ciscocsoc Wed, 12/02/2009 - 01:46
User Badges:
  • Silver, 250 points or more

I think you need to post your config. The short timeout might occur if you are using SSL SessionID as the stickiness factor. Also a packet capture of a client session would be helpful.


Cathy

Correct Answer
Gilles Dufour Wed, 12/02/2009 - 04:34
User Badges:
  • Cisco Employee,

switch/User1(config)# parameter-map type http Rebalance
switch/User1(config-parammap-http)# header ?
  modify  Modify header
switch/User1(config-parammap-http)# header modify ?
  per-request  This is applicable for every request/response
switch/User1(config-parammap-http)# header modify per-request


That's the paramter-map that you need to insert the header in every request.


The reason for the 1 minute is that your browser or your server keeps the connection open for that long.

If a new request (refresh) comes in during that period of time, we can reuse the existing connection.

ACE without the parameter-map does not add a new header.

After the 1 minute timeout (on the server or client - not ace) the connection is closed and when you do a refresh a new connection is open.

Since this is a new connection, ACE will insert the header.


The solution is the parameter-map above.


Gilles.

Actions

This Discussion