Alex Iliev | 8 Oct 10:10 2012
Picon

Long pauses / idle time in a Haskell TCP server

Hello,

I'm seeing long pauses in a server based on the 'scalable-server'
package from Hackage, version 0.2.2 [1]. It normally performs very
well, about 100-150 micro-secs client latency over the loopback
interface, but a fair number of requests are much slower, 38-40
milli-secs, making the mean latency and throughput quite bad.

The server is a simple version of a memory cache, with operations to
"put" a key-value mapping, and to "get" the value for a key, using a
data map. I've tried with the strict versions of
'unordered-containers' and the 'containers' package for the data map
implementation, with similar results.

I've tried it with ghc 7.4.1 and with 7.6.1 with similar results.

Runtime info I got shows:
- GC report: GC time is much less than the total time of the slow
responses, so does not explain them.
- CPU profile: Idle time is very high, and would explain the slow
responses. By idle time I mean the part of wall time which is not
included in the profile report's "total time". For example, when
running a test for 5 minutes, the profile report has total time = 0.05
secs. 'top' output is consistent - quite low CPU usage during such a
test. Apart from this there is nothing notable in the profile, most
time is spent in the network input and output processing
(network-enumerator etc.).

One observation is that the pauses seem correlated with overwriting
entries in the data map. If I'm mostly adding new keys (as well as
(Continue reading)

Gregory Collins | 8 Oct 10:34 2012
Picon

Re: Long pauses / idle time in a Haskell TCP server

On Mon, Oct 8, 2012 at 10:10 AM, Alex Iliev <alex.iliev <at> gmail.com> wrote:

Hello,

I'm seeing long pauses in a server based on the 'scalable-server'
package from Hackage, version 0.2.2 [1]. It normally performs very
well, about 100-150 micro-secs client latency over the loopback
interface, but a fair number of requests are much slower, 38-40
milli-secs, making the mean latency and throughput quite bad.

You might get more information from running threadscope on your program. 

G
--
Gregory Collins <greg <at> gregorycollins.net>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane