Some time ago i have found very interesting patch for FreeBSD kernel. Patch was originally posted by Andre Oppermann in freebsd-current maillist. That patch allows dynamically change TCP send and receive buffer sizes. However Andre posed version only for FreeBSD CURRENT, so i have make note to try patch as soon as i have chance to install CURRENT. But today, my colleague told me that he found version for 6.x, and i have spent last few hours for patching & testing. As i wrote before, patch allows dynamically change TCP buffer size. Using that patch you can save a lot of kernel memory, because you don’t need to set big values for socket buffers. TCP session will start with a small buffer size and grow to match network conditions. Andre showed about 1000% better performance in his tests.
Below you can find my test results.
(more…)