So I operate FreeBSD server that is connected to a 300 Mbps symmetrical fiber line. It often has to serve users on a different continent so the tested ping is anywhere from 100 to 300 ms, and in extreme cases 625 ms.

With worst case latency (625ms) I calculated that my Window size should be 18.75 MB. So I set my kern.ipc.maxsockbuf to 39321600 and both my net.inet.tcp.recvbuf_max and my net.inet.tcp.sendbuf_max to 19660800. But it didn't help much it's still very slow on arrival. I also tried enabling net.inet.tcp.path_mtu_discovery and it seemed to help a little, but with the server pushing into a 300 Mbps uplink, I'm only receiving about 12 Mbps when the download speeds are closer to 50 Mbps.

Am I missing anything, and what else can I do to optimize the server for the large pipe it's handling? Moving the server is not an option.

  • can you share the command line that you're using for iperf? If you're doing this with UDP, the behavior is strange. If it is TCP, this is expected, as TCP has issues with windowing on high latency links. – TheCompWiz Jul 2 '19 at 21:24
  • It is a TCP transfer iperf3 -w 4M --get-server-output -c <host> -R. The window size of 4M is as high as the Mac will allow but in this instance the latency is only 100 ms so it should be fine. – Cyberpower678 Jul 2 '19 at 21:27
  • Can you figure out the end-to-end MTU? Perhaps you can't transmit 1500 bytes in a packet, and you end up with fragmented packets. – TheCompWiz Jul 2 '19 at 21:35
  • @TheCompWiz that's the thing. I have net.inet.tcp.path_mtu_discovery enabled which basically sets the MTU to the lowest in the pipeline. – Cyberpower678 Jul 2 '19 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.