Hi Simon,
Packets's segment should be 16344 as the advertised value.
Wrong. The negotiated value is a maximum (the M in MSS means maximum),
not a guaranteed value. There is nothing wrong with TCP segments below
the MSS. Whether the stack is segmenting at MSS size depends on a lot of
things and changes from use-case to use-case, application to application.
Haproxy is highly optimized for efficiency. That is why you can reach
40Gbps and more with haproxy. It will behave differently than other
applications, yes, but that doesn't mean it behavior is irregular.
I saw other applicaption worked as expected.
Of course - each application behaves different. Other applications may
buffer data aggressively, shoving more data into the egress socket at
once, so the kernel can segment at a higher TCP segment size. That
doesn't mean the behavior of haproxy is not correct.
3. MSS option is invalid on FreeBSD.
Again, can you elaborate? What does "invalid" mean?
I have tested it with MSS 1200 and found haproxy advertised value have
not changed. The value is equal to client's advertised value, eg. 1460.
Haproxy doesn't advertise anything, your OS does. If this is true, then
it would be a FreeBSD bug, not a haproxy one. I do have my doubts about
this though. Do you have a tcpdump to show this behavior?
Again, what you believe is a misbehavior very likely isn't, you would be
better up to troubleshoot your actual issue with us.
Lukas