When sending many small SSL records, there might be too much overhead through
the record headers; when sending big SSL records, they might be bigger than the
maximum segment size (or even bigger than the TCP congestion window when uploading data).
The former case is probably hard to control since especially in handshake phase
we often only have small records to send, but for the latter case there might be packets spanning over 2-3 TCP segments, which we want to avoid because the server can only decrypt the packet once it has received all segments.
Testing on Wifi on a BlackBerry 10, I found the negotiated maximum segment size to be 1380 bytes.
So we could package our data into chunks to fit that size and feed that into
the SSL_write call or whatever OpenSSL does.
I also saw that servers send huge records of several thousand bytes, but I am
afraid there is nothing we can do there.
|For Gerrit Dashboard: QTBUG-28764|
|47803,1||SSL internals: align SSL record size to TCP segment size||dev||qt/qtbase||Status: ABANDONED||-2||0|
|47806,1||SSL benchmarks: add benchmark for uploading data||dev||qt/qtbase||Status: MERGED||+2||0|