8 Oct 2012 10:10
Long pauses / idle time in a Haskell TCP server
Alex Iliev <alex.iliev <at> gmail.com>
2012-10-08 08:10:42 GMT
2012-10-08 08:10:42 GMT
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)
RSS Feed