yesodweb/wai — Issue #40: Huge slowdown for request body of length 1025
Author: snoyberg
Created: 2012-02-01 16:14:55+00:00
State: open

Previously mentioned in yesodweb/yesod#248 by @luite

I can confirm that this is occurring, but now the weird part: the slowdown seems to be coming from the call to `network`'s `recv` function. I've added the following debug output to Warp:

, connRecv = do
time "connRecv start"
bs <- Sock.recv s bytesPerRead
time $ "connRecv finish, " ++ show (S.length bs)
return bs

Plus the helper function `time` and related imports:

import Data.Time
time s = liftIO $ do
now <- getCurrentTime
putStrLn $ show now ++ ": " ++ s

You can see clearly that connRecv finishes about a second after it starts.