]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: ssl: implement dynamic record size adjustment
authorWilly Tarreau <w@1wt.eu>
Sun, 2 Feb 2014 01:00:24 +0000 (02:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Feb 2014 10:37:29 +0000 (11:37 +0100)
commit7bed945be0cc9c91cd0114a9bcb965702f9389e3
treee60dd4d97284cb5f4494e754d057f7eca5a87702
parent1049b1f55137b6f28d829b81473ca495255b6e07
OPTIM: ssl: implement dynamic record size adjustment

By having the stream interface pass the CF_STREAMER flag to the
snd_buf() primitive, we're able to tell the send layer whether
we're sending large chunks or small ones.

We use this information in SSL to adjust the max record dynamically.
This results in small chunks respecting tune.ssl.maxrecord at the
beginning of a transfer or for small transfers, with an automatic
switch to full records if the exchanges last long. This allows the
receiver to parse HTML contents on the fly without having to retrieve
16kB of data, which is even more important with small initcwnd since
the receiver does not need to wait for round trips to start fetching
new objects. However, sending large files still produces large chunks.

For example, with tune.ssl.maxrecord = 2859, we see 5 write(2885)
sent in two segments each and 6 write(16421).

This idea was first proposed on the haproxy mailing list by Ilya Grigorik.
include/types/connection.h
src/ssl_sock.c
src/stream_interface.c