Adding irules to vip that loop over DGL that are normally empty - ok practise ?
Gurus
I have been doing a lot of work recently utilizing data group lists since they are simply awesome and I'm always trying to separate code from data.
I use them as simple arrays for listing strings or as hashes if I need key=value pairs.
Some examples I use dgl for are:
* Redirect "host" to "host.defaultdomain.com"
* Redirect "host1.defaultdomain.com" to "host.defaultdomain.com/defaultapp" by maintaining a "host1" := /defaultapp" key/value pair.
* Redirect host and/or uri to a new site optionally with fixed uri by maintaining "oldhost.domain.com := newhost.domain.com" and "olduri := newuri" key/value pairs.
* Turn on persistence cookie logging for debugging by adding a cookie name to a string dgl.
The idea is that nobody has to either edit iRules or even change iRule associations with VIPs - only edit data group lists. However, that of course only works if the VIP already
has all the necessary iRules associated with it - whether it's currently needed or not.
Example : log persistence cookies.
I have a dgl called "logged_persistence_cookies" which is usually empty. As standard part of any new HTTP VIP I use cookie persistence and name the persistence cookie uniquely after the app.
If I need to debug a persistence issue or need to know a certain host's stickieness details I simply add this app's persistence cookie's name to this dgl and it starts writing
persistence related info to the log. When done I remove the cookie name from the dgl again. Works perfectly !
My question is this:
The more of these dgl I add the more rules I need to add to every VIP. Most of the time most of the rules wind up doing nothing more than loop over empty data group lists so they effectively
do nothing but burn cpu cycles. Only the few times a year I add something to one of the dgl do they actually perform a useful task.
Is this bad practise ? Is looping over empty dgl cpu intensive ?
I really don't want anyone messing with irules or irule associations. I only want folks to maintain data group lists and it works very well from a functional perspective.
I'm just a bit concerned about all the empty looping going on most of the time.
Thoughts ?