Forum Discussion

NUT2889's avatar
NUT2889
Icon for Cirrostratus rankCirrostratus
Jul 02, 2014

After specify tcp::collect, the SMTP services is not working

Hi Guys,

 

Currently we have a problem about the memory on device isn't enough when iRule trigger traffic. Firstly, i found in the devcentral.f5.com about CLIENT_ACCEPTED and SERVER_CONNECT should be specify tcp::collect size and tcp::release on CLIENT_DATA and SERVER_DATA. My device was running BIG-IP 10.x that mean the tcp::collect able to collect maximum to 4MB.

 

You can referring my iRule from below link:

 

  1. link text --> This rule the service is work properly but found memory leak when device receive more connection.

     

  2. link text --> This rule is specify tcp::collect, the service wouldn't work. By the client able to receive only 220 OK from server.

     

I'm not sure to appropriate value of tcp::collect. And in case specify the value that effect to service isn't working.

 

Thanks.

 

4 Replies

  • This rule is specify tcp::collect, the service wouldn't work. By the client able to receive only 220 OK from server.

     

    i do not think you can specify collect byte in tcp::collect.

     

    This rule the service is work properly

     

    what are you (irule) trying to do?

     

    but found memory leak when device receive more connection.

     

    consuming too much memory and memory leak are not same. if it is memory leak, you had better open a support case to get it fixed.

     

    by the way, beginning in 9.4.4, $:: is no longer required to reference data group.

     

    CMP Compatibility (Class / Data Group List References)

     

    https://devcentral.f5.com/wiki/iRules.cmpcompatibility.ashx

     

  • First, understand that a single TCP packet will never hold anywhere near 4MB. It'll be spread across many TCP packets. The length value in the TCP::collect command is there, reasonably, to collect a specific amount of data versus the whole packet payload, and can certainly speed things up if what you're looking for is early on in the packet. In lieu of that, TCP::collect without a length argument, and someone correct me if I'm wrong here, should only cache the payload of the first packet in a session, unless the TCP::collect is called again immediately after a TCP::release. I've run into very few situations where the length value was absolutely required, and if you're experiencing an actual memory leak I'd open a support case.

     

  • what are you trying to do with smtp? There are some smtp irules in codeshare, and I wrote an article a while back walking through one of them. The trick with smtp and some other protocols is that while the client initiates the connection, the server is the first to send data, which requires a little extra in your iRule.

     

  • How can i know memory using in for each iRule?

     

    i am not aware of it but you may check with support engineer or see if somebody here knows.

     

    by the way, what are you trying to do? does the irule work indeed?

     

    in the RULE_SMTP_NORMAL.tcl, you do string toupper but helo and ehlo (in if-condition) are in lower case.

     

    also, in SERVER_DATA, there are 3 same if-conditions ($SERVDATA starts_with "250").