Set a better default for maxReadsPerEvent
authorDave Watson <davejwatson@fb.com>
Mon, 8 Dec 2014 18:25:14 +0000 (10:25 -0800)
committerDave Watson <davejwatson@fb.com>
Thu, 11 Dec 2014 16:01:16 +0000 (08:01 -0800)
Summary:
0 (infinity) seems like a bad default for this.  Just found a 2~5% latency win in thrift by setting this to something more reasonable.  Any reason not to set a better default globally?

Since this is already on for mcrouter/proxygen/thrift, the biggest change would probably be service router

tests postponed longer than 20 minutes

Test Plan:
thrift perf test, multifeed canary

Canary URL: https://our.intern.facebook.com/intern/feedtools/mycanary?id=davejwatson_20141208-102635_local.1418063194_d201eceec04e5e097a6dffb645a424d502db8742_

Reviewed By: afrind@fb.com

Subscribers: doug, net-systems@, njormrod, folly-diffs@, jsedgwick, haijunz, andrewcox, alandau, fugalh

FB internal diff: D1725142

Signature: t1:1725142:1418066284:c2e1cbf27b0c7a98cf2395f369683bbcce4cdce4

folly/io/async/AsyncSocket.cpp

index d18e3b6c3280e898a023007f7d006348674d7290..172b5bed235bd7b1c7bfb279472440c2e3539a6c 100644 (file)
@@ -234,7 +234,7 @@ void AsyncSocket::init() {
   eventFlags_ = EventHandler::NONE;
   fd_ = -1;
   sendTimeout_ = 0;
-  maxReadsPerEvent_ = 0;
+  maxReadsPerEvent_ = 16;
   connectCallback_ = nullptr;
   readCallback_ = nullptr;
   writeReqHead_ = nullptr;