Subscriptions: Video  |  Audio  |  Tutorials  |  Tech Tips  |  Features  |  More...
Subscriptions: Video  |  Audio  |  Tutorials  |  Tech Tips  |  Features  |  More...

Current Articles | Categories | Search | Syndication

by spark - 2326 views
  1. The Basics
  2. New Ways To Set Data
  3. New Ways To Alter Data
  4. Data Expiration
  5. Advanced Data Expiration
  6. Subtables
  7. Counting
  8. The Fine Print
  9. Examples

The BIG-IP is a powerful tool when it comes to managing your application traffic. One of the reasons is F5's CMP technology: the ability to scale across many CPUs by running independently on each of them. As any advanced iRule writer could tell you, though, this independence can sometimes make it difficult or impossible to treat the system as one cohesive whole. The problem is that maintaining a consistent set of data spread across processors like that is a long-standing one in computer science. There's just no way to do it in a general enough way for something like Tcl global variables to work and still get good performance.

In v10, the session table was the one small escape hatch for any iRule to have a globally available set of shared data and not be pinned to a single processor. Although it has existed in iRules for some time, the session command was never designed to be a general purpose tool for this sort of thing: the interface has a lot of unnecessary complexity, and there is significant missing functionality. But when you get down to brass tacks, it works; it solves the problem and maintains the speed we need.

With version 10.1, we've given the session table some long-sought functionality, and revamped its iRules interface completely to give users a new, cleaner, full-featured way to keep track of global data. We are very proud to introduce the table command...

There's quite a lot to cover, so we'll take it slowly.

The Basics

At its heart, the table command is just another way to access the session table, and the fundamental concepts are not much different than they were before. The session table is a global table shared across all processing units in the BIG-IP system. It stores values that are indexed by keys. An entry in the session table consists of a key, a value, and some associated metadata (which will be covered later). The session command allows you to set a key/value pair, lookup a value for a given key, or delete a key/value pair. It looks like this:

session add <mode> <key> <data> [<timeout>]
session lookup <mode> <key>
session delete <mode> <key>

where <mode> is a value that no longer has any meaning in v10, and <key> can take some baroque syntax, which is also meaningless in v10. When those commands are used, it might look like:

session add uie "$key any pool any virtual" $data 180
session lookup uie "$key any pool"
session delete uie "$key"

To someone unfamiliar with iRules, this might not make a lot of sense. What's "uie"? Why the "any pool" business? And what does any of this have to do with sessions?

When we set out to improve this interface, the first thing we did was to come up with a new command name, one that might hint that this is something general purpose that we're dealing with: hence, the table command. A new command name also ensures that any existing iRules using the session command wouldn't be interfered with. The second thing we did was get rid of all those bulky unused parameters. The table command’s basic form looks like:

table set $key $data 180
table lookup $key
table delete $key

That's already an improvement! But we didn't stop there. Not by a long shot.

Continue reading part two in the series: New Ways To Set Data


Rate This Article:

COMMENTS

There are currently no comments, be the first to post one.
Audio
Validating Data Group (Class) References
v10.1 - Configuring GTM's DNS Security Extensions
v.10 - Remote Authorization via TACACS+
v.10 - New class features in iRules
v.10 - iRules and the after command
v.10 - FastHTTP and Cookie Persistence
v.10 - A new iRules Namespace
Unbind your LDAP servers with iRules
Ten Steps to iRules Optimization
Tech Tip: Saving Your iControl Changes
Switch Gone Wild: Using Wildcards with the Tcl "switch" command
Stacking iRules: A Modular Approach
SNMP: Capturing SSL Statistics per Virtual Server
Selective DNS Persistence on GTM
Ruby Meets iControl: Switching Policies
Ruby meets iControl: Making Wide IPs
Ruby meets iControl: Creating VIPs
Rewriting Redirects
Replacing the WebSphere Apache Plugin with iRules
RADIUS Load Balancing with iRules
Polymorphism - Making TCL operators work for you
Persisting SSL Connections
Persisting Across Virtual Servers
Passive Application Monitoring with LTM
Monitoring TCP Applications #01
Managing The System Boot Location with iControl
LTM: Per-VLAN Default Gateways
LTM: Dueling Timeouts
LTM: Configuring IP Forwarding
LTM: Action on Service Down
iRules: Disabling Event Processing
iRules Update: New options for the "log" command
iRules Optimization 101 - #05 - Evaluating iRule Performance
iRules Optimization 101 - #04 - Delimiters: Braces, Brackets, Quotes and more
iRules Optimization 101 - #03 - for vs. foreach
iRules Optimization 101 - #02 - Expressions and Variables
iRules Optimization 101 - #01 - if, elseif and switch
iRules Event Order
iRules 101 - #15 - TCL List Handling Commands
iRules 101 - #14 - TCL String Commands Part 2
iRules 101 - #13 - TCL String Commands Part 1
iRules 101 - #12 - Validating Your Logic
iRules 101 - #11 - Events
iRules 101 - #10 - Regular Expressions
iRules 101 - #09 - Debugging
iRules 101 - #08 - Classes
iRules 101 - #07 - Catch
iRules 101 - #06 - When
iRules 101 - #05 - Selecting Pools, Pool Members, and Nodes
iRules 101 - #04 - Switch
iRules 101 - #03 - Variables
iRules 101 - #02 - If and Expressions
iRules 101 - #01 - Introduction to iRules
iRule Security 101 - #09 - Command Execution
iRule Security 101 - #08 - Limiting POST Data
iRule Security 101 - #07 - FTP Proxy
iRule Security 101 - #06 - HTTP Referer
iRule Security 101 - #05 - Avoiding Path Traversal
iRule Interference: Custom Closes and Responses
Investigating the LTM TCP Profile: Windows & Buffers
Investigating the LTM TCP Profile: The Finish Line
Investigating the LTM TCP Profile: Nagle’s Algorithm
Investigating the LTM TCP Profile: ECN & LTR
Investigating the LTM TCP Profile: Congestion Control Algorithms
Investigating the LTM TCP Profile: Acknowledgements
iControl Concept to Implementation (iC2I): The Introduction.
iControl Apps - #18 - Virtual Server Reverse Lookup
iControl Apps - #14 - Global Statistics
iControl Apps - #13 - System PVA Statistics
iControl Apps - #12 - Global SSL Statistics
iControl Apps - #11 - Global GTM Statistics
iControl Apps - #10 - Bigpipe List
iControl Apps - #09 - TMM Statistics
iControl Apps - #08 - System IP Statistics
iControl Apps - #07 - System Http Statistics
iControl Apps - #06 - Configuration Archiving
iControl Apps - #05 - Rate Based Statistics
iControl Apps - #04 - Graceful Server Shutdown
iControl Apps - #03 - Local Traffic Map
iControl Apps - #02 - Local Traffic Summary
iControl Apps - #01 - Disabling Node Servers
iControl 101 - #22 - GTM Data Centers
iControl 101 - #21 - Rate Classes
iControl 101 - #20 - Port Lockdown
iControl 101 - #19 - Time Conversions
iControl 101 - #18 - Stream Profile
iControl 101 - #17 - PortMirror
iControl 101 - #16 - SelfIPs
iControl 101 - #15 - System Services
iControl 101 - #14 - License Administration
iControl 101 - #13 - Data Groups
iControl 101 - #12 - Database Variables
iControl 101 - #11 - Performance Graphs
iControl 101 - #10 - System Inet
iControl 101 - #09 - iRules
iControl 101 - #08 - Partitions
iControl 101 - #07 - User Management
iControl 101 - #06 - File Transfer APIs
iControl 101 - #05 - Exceptions
iControl 101 - #04 - Language Options
iControl 101 - #03 - iControl Taxonomy
iControl 101 - #02 - How iControl Works
iControl 101 - #01 - iControl Marketing Dissected
iC2I: Automation - Creating Virtuals Simplified.
GTM, Know Thyself
Getting Started with pyControl
FTPS Offload via iRules
Exchange Persistence Duality and iRules
Dynamic WSDL updating with iRules
Custom SNMP Traps
Creating An iControl PowerShell Monitoring Dashboard With Google Charts
Cookie LoJack vi iRules
Content-Disposition - Forced file downloads via HTTP
Concurrent iControl Programming Explained
Case Insensitive Comparisons
Can iRules fix my cert mismatch errors?
Cache in with LTM and iRules
Building a Custom WebAccelerator Policy
Automated Web Analytics iRule Style
Investigating the LTM TCP Profile: Max Syn Retransmissions & Idle Timeout

Quick Start Guides