on master help sign in
selecting 3 for the number of HTTP/2 workers.
commit28312433fa818d3cd4e6c225a383f49b26e4f4fe authorKazu Yamamoto <kazu@iij.ad.jp> dateThu 17 Dec 2015, 10:44 (11 years ago) parent6497634
1 file changed+6−2
warp/Network/Wai/Handler/Warp/HTTP2.hs+6−2
warp/Network/Wai/Handler/Warp/HTTP2.hs+6−2
@@ -33,8 +33,12 @@ http2 conn ii addr transport settings readN app = do
3333 let responder = response ii settings ctx mgr
3434 action = worker ctx settings app responder
3535 setAction mgr action
36− -- fixme: hard coding: 10
37− replicateM_ 10 $ spawnAction mgr
36+ -- The number of workers is 3.
37+ -- This was carefully chosen based on a lot of benchmarks.
38+ -- If it is 1, we cannot avoid head-of-line blocking.
39+ -- If it is large, huge memory is consumed and many
40+ -- context switches happen.
41+ replicateM_ 3 $ spawnAction mgr
3842 -- Receiver
3943 let mkreq = mkRequest ii settings addr
4044 tid <- forkIO $ frameReceiver ctx mkreq readN