Forum Discussion

Jason_X_186825's avatar
Jason_X_186825
Icon for Nimbostratus rankNimbostratus
Feb 16, 2015

gzip string compression?

Hi,

I've been asked to send a JSON message containing various http headers and an XML payload from the HTTP request and HTTP response. Basically Logging the API calls and replies for downstream analytics. The XML payload is quite large most of the time and can be up to 5MB in size. Inspired by Hoolio's Log large HTTP payloads in chunks locally and remotely iRule I'm using HSL to send the JSON to a network server that's connected via Gig-E. However based on the amount of requests and responses in uncompressed form we are looking to get speeds of 6Gbps which will easily exceed the link speed. So I was looking to perform some form of compression on the JSON message that's being sent out using HSL::send but there doesn't seem to be a iRules method, function or library to perform string compression.

Anyone have any ideas or suggestions?

Can tcl libraries be manually added to a F5-BigIP? ie: in /usr/share/tcl8.4/ ?

Cheers, Jason

UPDATED:

Sadly according to this sol15434: Overview of the HTTP Compression profile when activated by a COMPRESS::enable in an iRule only compresses the HTTP Response. 😞

Selective Compression: When checked (enabled), HTTP compression is performed only when a configured iRule contains the COMPRESS::enable command. When cleared (disabled), compression is performed according to the other compression settings specified in the HTTP Compression profile.

Note: Data compression only compresses HTTP server responses, and not client requests.

2 Replies

  • Hi,

    in case you are on v11 you can use iFiles.

    The size limit is 4 MByte.

    An iFile can be imported via tmsh to the TMOS filestore and is available in an iRule.

    Place the file into a dedicated directory and run the following (works for a list of files):
    for file in `ls`; do ls -l | grep -iv '^total' | echo "tmsh create sys file ifile "$file" source-path file:"`pwd`"/"$file | bash -x; done
    
    for file in `ls`; do ls -l | grep -iv '^total' | echo "tmsh create ltm ifile "$file" file-name "$file | bash -x; done
    

    Maybe an automatism to compress and import into filestore is a workaround?

    Thanks, Stephan
  • am not from F5, but I think I can safely say that No, you cannot import additional TCL libs into iRules. Only what documented on devcentral is available, which is a small subset.

     

    a wild idea maybe if you could send your data to an http virtual server which performs compression when talking to your remote target servers.