Make MIN_WRITE_SIZE configurable for AsyncSSLSocket.
authorJun Li <albertli@fb.com>
Wed, 22 Apr 2015 21:09:07 +0000 (14:09 -0700)
committerAlecs King <int@fb.com>
Mon, 27 Apr 2015 23:51:34 +0000 (16:51 -0700)
commit12f0c056b4f3ecdfaa4cb3f10ed0d5f133e91f75
tree2c5860c32291373cf3975cdb24ebfd8f3f27c35c
parent6546b7b9f673f3bb65fe429c2b1c8670a4502a51
Make MIN_WRITE_SIZE configurable for AsyncSSLSocket.

Summary:
MIN_WRITE_SIZE is used to avoid small write calls to SSL_write. If there are
consecutive small buffers to write, then will be combined together(by being
copied to a local buffer) until total size exceeds MIN_WRITE_SIZE. This reduces
number of calls SSL_write, improving performance, and avoiding overhead in OpenSSL.

Currently, MIN_WRITE_SIZE is hard coded to be 1500 bytes.

Wormhole could benefit from this, as our average message size is several
hundreds of bytes. We could get even better throughput with larger
MIN_WRITE_SIZE.

As discussed with Adam and Alan, there is a good reason to make it
configurable, though default value is still 1500.

Test Plan: unit tests

Reviewed By: simpkins@fb.com

Subscribers: net-systems@, ssl-diffs@, folly-diffs@, yfeldblum, chalfant, thomasf

FB internal diff: D1996570

Tasks: 6784543

Signature: t1:1996570:1429667035:a661ef30a715dafec3e134a7f6af6f56ada2e8e0
folly/io/async/AsyncSSLSocket.cpp
folly/io/async/AsyncSSLSocket.h
folly/io/async/test/AsyncSSLSocketTest.cpp