From: Dave Watson Date: Mon, 8 Dec 2014 18:25:14 +0000 (-0800) Subject: Set a better default for maxReadsPerEvent X-Git-Tag: v0.22.0~122 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=142752b48c2c345ee171041c41f0c0f58bf4a803;p=folly.git Set a better default for maxReadsPerEvent 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 --- diff --git a/folly/io/async/AsyncSocket.cpp b/folly/io/async/AsyncSocket.cpp index d18e3b6c..172b5bed 100644 --- a/folly/io/async/AsyncSocket.cpp +++ b/folly/io/async/AsyncSocket.cpp @@ -234,7 +234,7 @@ void AsyncSocket::init() { eventFlags_ = EventHandler::NONE; fd_ = -1; sendTimeout_ = 0; - maxReadsPerEvent_ = 0; + maxReadsPerEvent_ = 16; connectCallback_ = nullptr; readCallback_ = nullptr; writeReqHead_ = nullptr;