FastL4 vs Optimized TCP Profiles

We run active/standby 6400 (platform D63a) LTM’s for our production applications. They are accessed via clients on a private network with an average latency around 80ms. Nearly all of our virtual servers are using the default standard TCP profile (nagle’s, bandwidth delay, low send/receive windows and proxy buffers). We’ve recently implemented an end-to-end response time analysis solution and have observed very high server response times for those applications that utilize the LTM.

We want to improve performance and obviously switching to either FastL4 or TCP LAN Optimized profile would do just that. But which one would be better ? I think taking advantage of the two TCP stacks would be a benefit but I am concerned with the increased CPU/memory utilization this would cause. FastL4 would put more burden on the server itself and I am not sure if that is a good thing or not. For the most part, we do not use any extensive iRules (only a simple SNAT rule), so both would be an option. Has anyone done a comparison between the two ?

Any tips are appreciated. Thanks in advance!

I have not done a direct comparison but in general the TCP LAN Optimized profile seems to work very well for reducing latency, even for clients not on the LAN (I have used it on applications where the average latency from the client is ~600ms and it still improved response time greatly).

Denny

If you’re only decisive at layer 4 and below (and you don’t need oneconnect), fastL4 is the way to go as it utilizes the Packet Velocity asic on your hardware (though only in assist mode in your case since you’re using snat). If you want to optimize http in any way, you’ll need the tcp+http profile combination. I’ve done this with the lan-optimized profile with 20000 connections/second at 300 Mbps traffic on a 3400 (single processor) and CPU never hit 15% and the memory utilization never climbed above 400MB. The 6400 is rated much much higher than that, so unless you are currently really pushing the box, you should be fine with the optimized profile. I would recommend the LAN optimized, even with the WAN environments, it has worked well for me and I’ve heard the same from other users that it performs better. Your mileage may vary, so test if you can, set up a vip in parallel that you can push X percentage of users to for piloting.

We are not pushing the box at all right now. CPU and memory utilization are relatively low. I assumed FastL4 would be best since it processes the traffic in hardware. Same reasons switches operate faster than routers (hey, I am a network engineer!). When you say “if you want to optimize http in any way”, do you mean for those VIP’s where FastL4 is not an option ? Most of our VIPs will be able to use FastL4 but for those that can not we will definitely move to LAN Optimized on both sides. Thanks again. I really hope this makes a difference.

your biggest help will be in the windowing and proxy buffers. To give you a real world, when I replaced a local director with the LTM, the performance dropped across the board, increasing the front page paints by 100% (yes, that bad). first thought was what the heck is wrong with this fancy new gear? Turns out nothing…the local director did nothing to TCP except port mapping and the web servers tcp stacks had been tuned. Well, the LTM is a full proxy, so all that tuning was now gone in reference to the client. Once we tuned the stack on the LTM, not only did performance come back in line across the board, but improved significantly in some areas with no noticable change in LTM performance. If you check the docs section of this site, I’ve been writing a series on the tcp profile

I was basically in the same position as you about a year ago. By doing a lot of tcp trace analysis, I was able to conclude that basically the LTM was throttling down all of our application traffic - much the same way yours is. It took a lot of studying and analysis, but I eventually came out with a TCP profile that is no longer throttling the connections. From my perspective, here are the most important settings:

Proxy Buffer Low: 98304

Proxy Buffer High: 131072

Send Buffer: 65535

Receive Window: 65535

Slow Start: disabled

Nagle’s Algorithm: disabled

This tcp profile used for both our Client and Server connections. First I adjusted the four buffer settings. Next, I disabled Nagle. Finally I disabled Slow Start. Each individual step in that process significantly improved our TCP performance.

Like you, I was also concerned about CPU/memory utilization when adjusting these parameters (our platform is also 6400s). One of our pairs has a max number of connections of 1.5 million, and pushes over 500Mbps at times. And I haven’t seen any noticable change to the CPU or memory utilization after these tcp profile adjustments. But to be honest, it was a leap of faith to get there. I couldn’t come up with any way to measure the potential impact. The good news is that the changes don’t disrupt traffic processing, and it is very easy and quick to back out.

What I concluded in a general sense is, with the default tcp profile settings, the LTM sends a limited number of data packets to the client before it sits and waits for an acknowledgement. On a circuit with an 80ms delay, this time adds up quickly. By changing the tcp parameters to the ones I noted above, the LTM now tries to fill up the entire client receive window resulting in much higher throughput.

“Throttling down” is not a shortcoming in the product, it’s really the LTM’s tcp stack complying with the configuration in the system. I had a table in my tech tip on windows and buffers (DevCentral - An F5 Technical Community Click here) that presents a table that shows the practical max throughput numbers at various window sizes and latencies, and it’s really shocking how poor throughput is when latency grows even a little bit, and that’s not even taking into account loss. A small congestion window can really hamper a tcp sender’s ability to deliver data due to the nature of tcp being a reliable transport protocol, which requires feedback from the receiver before pushing too much data at once.

LTMs are astoundingly robust - I continue to be amazed at how well they perform. I definitely did not mean to imply there were any shortcomings in the product. The throttling was absolutely due to the way we had configured the TCP profile (or more accurately, did not configure the TCP profile).

And the articles you wrote are an excellent resource. Thank you for them. I have referenced them many times already.

Oh, I didn’t take it that way at all, just clarifying. Thanks for feedback, and if you have any other product features you’d like me (or one of the other guys) to write a series on, let me know.

Thanks for the quick and detailed responses. Still though, I am not sure which one to use (FastL4 or Optimized). We are already moving a single VIP over to FastL4 on Tuesday morning. Doing so will put more of a burden on the physical servers themselves, correct ? That’s why I am leaning towards using the optimized profile but obviously I want whatever is fastest and most efficient. Maybe after a week of running on FastL4, I’ll see about switching it over to the TCP optimized profile to compare the results… Thanks once again !

Citizen will probably give you a better answer than this. But if it were me, I would ask myself whether or not I need the LTM to do any manipulation of the traffic. For example if this were an HTTP application, would I need to use iRules to read the URI or headers? If the LTM doesn’t need to look this high into the packet, then I’d use a FastL4.

I think all else being equal, FastL4 is faster.

I agree with smp, fastL4 will be better unless you need the features above tcp. You probably won’t see much impact on the servers, though if the tcp overhead becomes a problem on the server side, you could implement oneconnect with the optimized tcp profiles, and that will reuse connections to your servers so that the high cost of setup and teardown is eliminated. There are a lot of ways to skin the cat and plenty of nuances in every environment that there isn’t a one size fits all approach, and the functionality is there exactly for this reason.

Well, we made the change this morning. For reasons we are still investigating, after moving to FastL4, the VIP went down and the application stopped working. It did not come back up until we switched over to TCP-LAN-Optimized on both sides (did not try reverting back to the default standard).

After moving to this optimized profile, we’ve seen roughly a 100ms decrease in Data Transfer Time (the time between the first reply sent by the server and the last packet sent to fufill the request). The server response time has dropped by about 30ms. I was expecting this to drop further but it’s probably due to the application being poorly written.

One question I do have is in regards to the Server TCP window size. I ran a packet trace after the change and when the server responds, the initial TCP window size is always 4380. The client’s initial request is always at 65535. By using the TCP Lan Optimized profile, the F5 is acting as a proxy and negotiating the TCP parameters, correct ? I was under the impression that when others here have made this same change, they noticed the TCP window size opened up on the server side. Any ideas ?

Maybe it’s about the right time to have you post your VIP config from the bigip.conf. It’s possible you have other settings applied to the VIP which conflict with a FastL4 profile??? Also it might be helpful to paste the values of the TCP profile you have applied.

Regarding the window size…the behavior you see was bothering me for a long time until it finally clicked in my brain. Yes, the TCP window size always starts at 4380. The trick is to understand whether the LTM is sending or receiving data. When the LTM is sending data, as in this case, there is no need for the LTM to increase its receive window - which is the parameter you refer to in the trace.

When the LTM is receiving large amounts of data and you do a trace, you’ll see that the LTM receive window starts out at 4380, and quickly increases to the value of the Receive Window as specified in the TCP profile that is applied.

The LTM is smart - it starts out with a small window size so it does not need to allocate more memory than necessary for the TCP connection. If it needs to adjust the receive window (when it is receiving data), you’ll see it go up.

Here is the config. Thanks for clarifying the window size issue. That makes perfect sense.

profile fastL4 fastL4 { 
     reset on timeout enable 
     reassemble fragments disable 
     idle timeout 300 
     max segment override 0 
     pva acceleration full 
 } 
  
 pool wmtis03ssl { 
    snat disable 
    nat disable 
    monitor all tcp 
    member 10.212.xxx.xxx:5553 session disable 
    member 10.212.xxx.xxx:40202 
    member 10.212.yyy.yyy:5553 session disable 
    member 10.212.yyy.yyy:40202 
 } 
  
 pool wmtis03ssl_SNAT { 
    monitor all tcp 
    member 10.212.xxx.xxx:5553 session disable 
    member 10.212.xxx.xxx:40202 
    member 10.212.yyy.yyy:5553 session disable 
    member 10.212.yyy.yyy:40202 monitor tcp 
 } 
  
 rule wmtis03ssl_Irule { 
    when CLIENT_ACCEPTED { 
    if { [IP::addr [IP::client_addr] equals 10.212.xxx.0/255.255.254.0] } { 
       pool wmtis03ssl_SNAT 
    } else { 
       pool wmtis03ssl   } 
 } 
 } 
  
 virtual wmtis03ssl_VIP { 
    destination 10.212.aaa.aaa:5553 
    ip protocol tcp 
    pool wmtis03ssl 
    rule wmtis03ssl_Irule 
 } 
  
 profile tcp tcp-lan-optimized { 
    defaults from tcp 
    slow start disable 
    bandwidth delay disable 
    nagle disable 
    proxy buffer low 98304 
    proxy buffer high 131072 
    send buffer 65535 
    recv window 65535 
 }

Brad, a bit off topic, but would you mind sharing how you are conducting these response time tests? Thanks!

Josh

Posted By jbaird on 01/20/2009 8:03 PM

Brad, a bit off topic, but would you mind sharing how you are conducting these response time tests? Thanks!

Josh

I am using a product by NetQos called Superagent. It measures end to end application response time by passively monitoring TCP traffic and calculating metrics based off of the header information. You specify servers, application ports and networks. Right now since we are monitoring in front of where our LTM sits on the network, many of the servers are the VIPs themselves. It’s nice being able to determine the exact performance gains when making a change like this.

I’ve attached screenshots off the application performance before and after the profile change was made. An hour worth of data today and then an hour last Wednesday.

Looks nice. Do you know of any other (free) products similar to this?

The upper bound for TCP’s initial window is represented by this formula:

min (4*MSS, max (2*MSS, 4380 bytes))

4380, by the way, is 3*MSS (1500 MTU - 20 IP - 20 TCP = 1460, which *3 = 4380.

And smp is absolutely spot-on on the clientside of LTM regarding window size, client is not sending much except a request, so the LTM stack has no reason to increase the window. If you look at the flow on the serverside, in this perspective, the server is the client and will need to increase the window to maximize efficiency in receiving the data from the server.