Stop Using the Base TCP Profile!
[Update 1 Mar 2017: F5 has new built-in profiles in TMOS v13.0. Although the default profile settings still haven't changed, there is good news on that from as well.]
If the customer data I've seen is any indication, the vast majority of our customers are using the base 'tcp' profile to configure their TCP optimization. This has poor performance consequences and I strongly encourage you to replace it immediately.
What's wrong with it?
The Buffers are too small. Both the receive and send buffers are limited to 64KB, and the proxy buffer won't exceed 48K . If the bandwidth/delay product of your connection exceeds the send or receive buffer, which it will in most of today's internet for all but the smallest files and shortest delays, your applications will be limited not by the available bandwidth but by an arbitrary memory limitation.
The Initial Congestion Window is too small. As the early thin-pipe, small-buffer days of the internet recede, the Internet Engineering Task Force (see IETF RFC 6928) increased the allowed size of a sender's initial burst. This allows more file transfers to complete in single round trip time and allows TCP to discover the true available bandwidth faster.
Delayed ACKs. The base profile enables Delayed ACK, which tries to reduce ACK traffic by waiting 200ms to see if more data comes in. This incurs a serious performance penalty on SSL, among other upper-layer protocols.
What should you do instead?
The best answer is to build a custom profile based on your specific environment and requirements. But we recognize that some of you will find that daunting! So we've created a variety of profiles customized for different environments. Frankly, we should do some work to improve these profiles, but even today there are much better choices than base 'tcp'.
If you have an HTTP profile attached to the virtual, we recommend you use tcp-mobile-optimized. This is true even if your clients aren't mobile. The name is misleading! As I said, the default profiles need work.
If you're just a bit more adventurous with your virtual with an HTTP profile, then mptcp-mobile-optimized will likely outperform the above. Besides enabling Multipath TCP (MPTCP) for clients that ask for it, it uses a more advanced congestion control ("Illinois") and rate pacing. We recognize, however, that if you're still using the base 'tcp' profile today then you're probably not comfortable with the newest, most innovative enhancements to TCP. So plain old tcp-mobile-optimized might be a more gentle step forward.
If your virtual doesn't have an HTTP profile, the best decision is to use a modified version of tcp-mobile-optimized or mptcp-mobile-optimized. Just derive a profile from whichever you prefer and disable the Nagle algorithm. That's it! If you are absolutely dead set against modifying a default profile, then wam-tcp-lan-optimized is the next best choice. It doesn't really matter if the attached network is actually a LAN or the open internet.
Why did we create a default profile with undesirable settings?
That answer is lost in the mists of time. But now it's hard to change: altering the profile from which all other profiles are derived will cause sudden changes in customer TCP behavior when they upgrade. Most would benefit, and many may not even notice, but we try to not to surprise people.
Nevertheless, if you want a quick, cheap, and easy boost to your application performance, simply switch your TCP profile from the base to one of our other defaults. You won't regret it.
- Martin_DukeRet. EmployeeI understand this profile will be applied to the Client Protocol Profile. Should we also apply this to the Server Protocol Profile for a LAN connected server pool?
On the serverside, the BIG-IP is generally the TCP receiver. That, combined with LAN characteristics, make it matter much, much less what profile you choose. That said, I would recommend you run tcp-lan-optimized in LAN scenarios.
- Varma_DantuluriHistoric F5 AccountDo the recommendations in 'What you should do instead?' apply for SWG/Forward Proxy deployments as well? SWG deployments will usually have a http profile attached.
- Martin_DukeRet. EmployeeDo the recommendations in 'What you should do instead?' apply for SWG/Forward Proxy deployments as well? SWG deployments will usually have a http profile attached.
I don't see a reason that those deployments would have dramatically different path dynamics. However, TCP profiles are most important when BIG-IP is sending data over the open internet -- and in a forward proxy, in general you are receiving it. So it's not that the recommended profiles don't apply, it's that they matter less.
- ZdendaCirrus
Hi, we have been using tcp-lan-optimized for most of our deployments. I assumed this is good choice among all profiles. Do you think it is worth to change it to any of profiles you recommended?
- rrrrrrrrrrrrrr1Nimbostratus
Serious performance problems using tcp-mobile-optimized profile
I have special hardware tokens containing client certificates (client ssl profile require setting). When using tcp-mobile-optimized profile (client) a first connection is done only in 30 seconds. When using protocol profile (client) standard = tcp: the connection is done instead within approx. 10 seconds When using protocol profile (client) = tcp-lan-optimized: the connection is done instead within approx. 8 seconds When using protocol profile (client) = tcp-legacy: approx 12 seconds
- Martin_DukeRet. Employee
Hi, we have been using tcp-lan-optimized for most of our deployments. I assumed this is good choice among all profiles. Do you think it is worth to change it to any of profiles you recommended?
If your environment is more like a LAN that other link types, then no.
- ZdendaCirrus
Martin Duke: not really, it is mixed. Some services published to internet, some services published to customers via private links, mpls etc..
- Martin_DukeRet. Employee
In my opinion, the best current profile we have for general internet use (with many different link types) is mptcp-mobile-optimized. In 13.1 we will release some new built-in profiles that give you some better options.
How to test these profile on F5, is there any method or tool or just ninja TCP skill using tcpdump etc. Just want to know how people test these profile and decide base on what matrix?
- Martin_DukeRet. Employee
I would suggest TCP Analytics to do this; set up one virtual with one profile, one with another, and compare.
https://devcentral.f5.com/articles/introducing-tcp-analytics-20425