Forum Discussion
Diego_19194
Nimbostratus
Aug 14, 2007iRule limits
I am writing a iRule where check in a regexp a number in the mail message.
To do that, I used the command matches_regex but when I finished the regexp to add in the iRule, I found it is so big.
Could you tell me what is the regexp limit recommended to use in a iRule?
A text file with all regexp has a size of 500K. I can't upload in the forum because we have a limit of 100K.
16 Replies
- Diego_19194
Nimbostratus
I shared my script with you. This was wrote in perl and it is very efficient.
About use switch/if statement, I think they are big values to do that. However, I can test it, but I need to write a new script to do that.
My last questions, if anyone know, are what is the limit in performance to LTM? and Can we do a iRule that read an external file?
Thanks - Deb_Allen_18Historic F5 AccountThe iRule itself cannot live in an external file, but the datagroup(s) it references can.
/deb - Diego_19194
Nimbostratus
I tested some part with datagroup and I think it is the best way.
Thanks to everyone for your help. - I believe iRules have an internal memory limit of 4MB. Thus, your regexp may cause an LTM failure if your regexp causes the iRule to consume more than 4MB of RAM. Please check the regex for greediness.
- Deb_Allen_18Historic F5 AccountGood point.
The actual functional limit is more like 1MB of data after charset / encoding expansions take place.
tcl requires contiguous memory allocation for such operations, and if the content against which you are running the regex is more than ~1MB or a large enough contiguous memory block cannot be allocated, you will definitely see page load failures, and extreme resource exhaustion from repeated allocation of large contiguous memory blocks can cause LTM to fail.
(It's worth pointing out that the size of the iRule itself is not relevant to that limit, but may cause the config file to grow to an unmanageable size.)
/deb - Leslie_South_55
Nimbostratus
Deb
How do you determine what your current memory allocation is? I have an iRule that uses several large class files and want to make sure we don't hit this limit.
Thanks
-L
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
