Forum Discussion

wfaulk_98141's avatar
wfaulk_98141
Icon for Altostratus rankAltostratus
Aug 20, 2014

iRule change pool for only one request

I want an iRule that looks like this:

when HTTP_REQUEST {
  switch -glob [HTTP::path] {
    "/cgi-bin/*" { pool cgi_pool }
  }
}

However, I find that this sometimes creates problems. I suspect that it's due to persistent HTTP connections, and once that connection makes a request to

/cgi-bin/*
once, all future requests use the new pool. (If someone can confirm or deny that, that would be great.)

So I modified the iRule to look like this:

when HTTP_REQUEST {
  switch -glob [HTTP::path] {
    "/cgi-bin/*" { pool cgi_pool }
    default { pool default_pool }
  }
}

Which seems to work. But then that causes problems when I have another iRule that also changes the pool. If that other iRule comes first, its changes get overridden by this one, and that gets to be easily forgettable management overhead.

So my question is:

Is it possible to have a pool change be in effect for only one particular HTTP request and not have to manually select the default pool for all of the other requests?

I'd be fine with terminating the HTTP session after the oddball request, but I can't see a simple way to tell the iRule to complete this one request, and then close the connection.

1 Reply

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    wfaulk,

     

    The LTM is connection based rather than request based so multiple http requests within one connection will get load balanced/persisted the same - the logic has already been set.

     

    The way around this could be to apply a oneconnect profile to the VIP as this, in effect, turns the LTM (and the VIP) into request based.

     

    See if that helps,

     

    N