httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivan <>
Subject [users@httpd] disable OutputBuffer filtering
Date Sun, 01 Nov 2009 20:00:42 GMT

I want to have a directory with file serving throttled to emulate a slow
connection for site debugging purposes. Is there an obvious solution i haven't
thought about? This is what i managed to come up with so far:

ExtFilterDefine slowdown mode=output cmd=/var/www/slow/slowCat
<Location /slow/>
        SetOutputFilter slowdown

The slowCat is a short program (written in haskell) which disables buffering and
pipes data from stdin to stdout, chracter by character, with a tiny sleep after
each character. When i try it in the shell, it works just right.

I would expect the server to send the data piecemeal to the client (and the
client to parse the data node by node, web browsers do that), but what happens
instead is a long delay and then the data arriving in a single burst. My
conclusion is that apache is buffering the data somewhere. What am i doing
wrond, is there any solution to this problem?

Any help much appreciated
Ivan Vadovic

The slowCat appears to work right and looks like this:

import System.Posix
import System.IO
import System.IO.Error

main :: IO ()
main = do hSetBuffering stdout NoBuffering
          hSetBuffering stdin NoBuffering
          try copy
          return ()

copy :: IO ()
copy = getChar >>= putChar >> usleep (10 ^ 4) >> copy

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message