@@ -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