Forum Discussion
jma_44485
Nimbostratus
Oct 10, 2009Irule question about Hash persistence
Hi,
I am really newbie of Irules. The issue I have is that the load is not balanced on our web servers. I have virtual server AAA in BigIP LTM. Hash_persistence profile is assigned to the virtual server AAA. Irule is assigned to the hash persistence profile. The Irule forwards http request to a pool "webpool" with round robin method. Two nodes are in that pool.
The irule is like following.
if { [HTTP::header host] eq "xxx.xxx.com" } {
pool webpool}
elseif { [HTTP::header host] eq "xxx.xxx.com" } {
pool webpool}
...
I have been trying to figure out why the load cannot be balanced in the webpool. I see the Irule "when HTTP_REQUEST { persist hash [HTTP::uri]}" posted on DevCentral, but I don't know how to use it in our environment. Can anyone shed some lights to me?
Many Thanks
19 Replies
- hoolio
Cirrostratus
Are you using cookie hash persistence or the hash persistence profile which references an iRule?
What is the criteria you want to use the persist clients? Do you have two different web apps being hosted by the same LTM virtual server where you send requests to two different pools based on the host header value?
If you have two pools you want to select between based on host header and you want to use cookie insert persistence, you could add an iRule or two HTTP classes which select the pool and then use the default cookie insert persistence profile. This is described in a few posts:
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=6031860322
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=31&tpage=1&view=topic&postid=1753117547
Aaron - hoolio
Cirrostratus
dupe - jma_44485
Nimbostratus
Thanks for the reply.
I am using hash_persistence profile which references an irule.
I have multiple web applications being hosted by one LTM virtual server. The LTM virtual server is DNS A record. My web applications' are DNS alias. I only have one pool. I have two nodes (two web servers) in that pool. I can see that all the http connections are only on one node. I want to balance the load to two nodes. My understanding is that when I type the web app's URL on a client computer, DNS is resoved and find the public IP of the LTM virtual server. The LTM virtual server has a hash_persistence profile assigned. The hash_persistence profile has a Irule assigned. According to the Host Header in the Irule, http request is forwarding to pool. The Pool uses Round Robin method. The load should be balanced.
What is the criteria I want to use the persist clients? The web applications are dotnet apps. I want to make sure the users always communicate to the web app on one web server where he/she first lands on before he/she logs out.
Thanks - hoolio
Cirrostratus
Are the DNS aliases on the same domain? If you only have one pool and all pool members answer for both host header values, why are you inspecting the host header?
Have you tried removing the hash persistence profile, adding a cookie insert persistence profile and testing?
Aaron - jma_44485
Nimbostratus
I am trying to figure out why http requests are not balanced according to my above configuration. If LTM checks persistence after http request is trigged, the new requests should be forwarded to the other node in the pool. Not sure if I use the wrong irule.
Thanks - hoolio
Cirrostratus
Are the DNS aliases on the same domain? If you only have one pool and all pool members answer for both host header values, why are you inspecting the host header?
Have you tried removing the hash persistence profile, adding a cookie insert persistence profile and testing?
Aaron - jma_44485
Nimbostratus
I am trying to figure out why http requests are not balanced according to my above configuration. If LTM checks persistence after http request is trigged, the new requests should be forwarded to the other node in the pool. Not sure if I use the wrong irule.
Thanks - hoolio
Cirrostratus
Are the DNS aliases on the same domain? If you only have one pool and all pool members answer for both host header values, why are you inspecting the host header?
Have you tried removing the hash persistence profile, adding a cookie insert persistence profile and testing?
Aaron - jma_44485
Nimbostratus
I am trying to figure out why http requests are not balanced according to my above configuration. If LTM checks persistence after http request is trigged, the new requests should be forwarded to the other node in the pool. Not sure if I use the wrong irule.
Thanks - jma_44485
Nimbostratus
Yes, DNS alias are on the same doman. They are like "abc.AAA.com", "123.AAA.com", "xyz.AAA.com", etc.
[If you only have one pool and all pool members answer for both host header values, why are you inspecting the host header? ]
I have no idea why they use following irules to check headers. Is there anything I can improve the following irule if I still use hash_persistence? I will look into cookie insert profile. Thanks
if { [HTTP::header host] eq "xxx.AAA.com" } {
pool webpool}
elseif { [HTTP::header host] eq "xxx.AAA.com" } {
pool webpool}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
