Forum Discussion
Doug_24189
Nimbostratus
Jun 02, 2006Optimizing external class array
We are testing an i-rule that uses an external array to pull in two variables (customer ID, transaction limit).
When testing the rule with a limited amount of records performance is excellent. At a certain point the number of records greatly affects overall CPU usage.
As I understand it the TCL Array is essentially a hashmap under the covers (as it supports non-numeric indexes) is there any way to control the initial allocated size? This should, in principle, allow us to control the number of hash buckets created and therefore the overflow chain length which may significantly affect performance.
In essence, is there a way to minimize CPU affect with a large class array?
2 Replies
- unRuleY_95363Historic F5 AccountThere are a couple of confusing points in your post.
First, are you talking about and external class/datagroup? I would assume so, since that's currently the only way to pull in external data to an iRule (well, not entirely as a separate virtual could be configured solely for the purpose of updating a Tcl Array).
Second, Tcl Array's and F5 classes are not the same. Both are similar in that they are implemented on hash maps, but also very different. Tcl Array's use a hashmap to index a value stored in the array. F5 classes generally are used to merely indicate whether something exists though there are a number of people who use them like Arrays. I can only assume your doing the latter???
Lastly, no there is not a way to influence the initial allocated size of either a Tcl Array or an F5 class.
Also, when are you experiencing the CPU impact. Is it during an update to the class (assuming that's what you are using), or is it while accessing the class?
Perhaps whatever you're doing would be better done with a Tcl Array, we'd just have to overcome the different challenges of how to initialize and manage that array. - Doug_24189
Nimbostratus
Thanks for the response -
The implementation loads an array from a file with username and the number of transactions allowed for that particular user.
i.e. bigpipe class client_array extern filename ext.txt
Also, when are you experiencing the CPU impact. Is it during an update to the class (assuming that's what you are using), or is it while accessing the class?
> It is when accessing the class
Perhaps whatever you're doing would be better done with a Tcl Array, we'd just have to overcome the different challenges of how to initialize and manage that array.
> I am open to that as long as we can manage the addition and subtraction of users daily without too much interruption. I would appreciate suggestions.
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
