Forum Discussion
Carol_Williams_
Nimbostratus
Oct 28, 2009help optimize iRule
Could someone please help me. I have a redirect iRule that is slow. I need to make sure all images are 1 not going through my httpclass profile and 2 if they are coming from a list of BOTs going to my botpot. The iRule I have works but is slow when the site is under a load.
when HTTP_REQUEST {
if { [matchclass [HTTP::uri] ends_with ::images] } {
if { [matchclass [HTTP::header User-Agent] contains ::robots] } {
pool MyBotPool
} else {
pool MyImagePool
}
HTTP::class disable
}
}
Thank You
Carol Williams
- hoolio
Cirrostratus
Hi Carol,when HTTP_REQUEST { if { [matchclass [HTTP::uri] ends_with ::images] } { if { [matchclass [HTTP::header User-Agent] contains ::robots] } { pool MyBotPool } else { pool MyImagePool } HTTP::class disable } }
- hoolio
Cirrostratus
Sorry, I had the indentations on your iRule wrong. The HTTP::class disable command is only being run for image requests:when HTTP_REQUEST { if { [matchclass [HTTP::uri] ends_with ::images] } { if { [matchclass [HTTP::header User-Agent] contains ::robots] } { pool MyBotPool } else { pool MyImagePool } HTTP::class disable } }
- Carol_Williams_
Nimbostratus
Aaron, - L4L7_53191
Nimbostratus
Carol: This may or not help, but one thing to keep an eye out for in cases like this is SNAT pool exhaustion if you're using snat on this virtual server. It'll show itself as random delays which affect overall performance (or worse in some cases). - hoolio
Cirrostratus
At the application layer, I'd suggest you consider using RAM caching to handle static content instead of bypassing ASM. On a conceptual level, RAM cache + ASM provides good security in that the first request for static content is validated by ASM before being sent to the pool. Once the pool member responds, LTM caches the response content in memory and then answers subsequent requests for the same content from cache. You should see good decreases in both ASM resource utilization as well as load on the static content servers. You may even have an existing amount of RAM Cache licensed, depending on which platform and version you are using. You can check with your account manager for details on this. - JRahm
Admin
Aaron, you are one amazing talent, and a wonderful cornerstone to this community. - Carol_Williams_
Nimbostratus
Aaron,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects