[Haskell-cafe] Re: Threads with high CPU usage

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Tue Dec 23 09:02:42 EST 2008


On Tue, 2008-12-23 at 03:56 +0100, wman wrote:
> Thanks to you all for inspiration.
> 
> My web app (which otherwise ran ok) was getting stuck while getting
> harassed by ab (apache-benchmark) after receiving some 800+ requests
> in short succession (not less, never gotten to 900, what was weird
> that running like 500 reqs - pause - 500 reqs ... went ok).
> 
> After compiling with -threaded and running with +RTS -N2 it handles
> 10k+ requests (with 10 concurrent request running at once) without
> missing a beat.

How about compiled with -threaded and running with just +RTS -N1 ?

I would expect the crucial thing is the -threaded not the number of cpus
running Haskell code concurrently (-threaded uses a pool of OS threads
to make blocking foreign calls effectively non-blocking).

Duncan



More information about the Haskell-Cafe mailing list