Mio: a high-performance multicore io manager for GHC

Haskell threads provide a key, lightweight concurrency abstraction to simplify the programming of important network applications such as web servers and software-defined network (SDN) controllers. The flagship Glasgow Haskell Compiler (GHC) introduces a run-time system (RTS) to achieve a high-performance multicore implementation of Haskell threads, by introducing effective components such as a multicore scheduler, a parallel garbage collector, an IO manager, and efficient multicore memory allocation. Evaluations of the GHC RTS, however, show that it does not scale well on multicore processors, leading to poor performance of many network applications that try to use lightweight Haskell threads. In this paper, we show that the GHC IO manager, which is a crucial component of the GHC RTS, is the scaling bottleneck. Through a series of experiments, we identify key data structure, scheduling, and dispatching bottlenecks of the GHC IO manager. We then design a new multicore IO manager named Mio that eliminates all these bottlenecks. Our evaluations show that the new Mio manager improves realistic web server throughput by 6.5x and reduces expected web server response time by 5.7x. We also show that with Mio, McNettle (an SDN controller written in Haskell) can scale effectively to 40+ cores, reach a throughput of over 20 million new requests per second on a single machine, and hence become the fastest of all existing SDN controllers.

[1]  David E. Culler,et al.  SEDA: an architecture for well-conditioned, scalable internet services , 2001, SOSP.

[2]  Rob Sherwood,et al.  On Controller Performance in Software-Defined Networks , 2012, Hot-ICE.

[3]  Andreas Voellmy,et al.  Scalable software defined network controllers , 2012, SIGCOMM '12.

[4]  Simon L. Peyton Jones,et al.  Concurrent Haskell , 1996, POPL '96.

[5]  Michael Snoyman Warp: A Haskell Web Server , 2011, IEEE Internet Computing.

[6]  Simon L. Peyton Jones,et al.  Towards Haskell in the cloud , 2012, Haskell '11.

[7]  A. Brown,et al.  The Architecture of Open Source Applications , 2011 .

[8]  Jonathan Lemon Kqueue - A Generic and Scalable Event Notification Facility , 2001, USENIX Annual Technical Conference, FREENIX Track.

[9]  Simon L. Peyton Jones,et al.  Runtime support for multicore Haskell , 2009, ICFP.

[10]  Tony Burgess,et al.  The Language Report , 1974 .

[11]  Joe Armstrong,et al.  Programming Erlang: Software for a Concurrent World , 1993 .

[12]  Eric A. Brewer,et al.  USENIX Association Proceedings of HotOS IX : The 9 th Workshop on Hot Topics in Operating Systems , 2003 .

[13]  Satnam Singh,et al.  Parallel performance tuning for Haskell , 2009, Haskell.

[14]  Ling Shao,et al.  Allocation wall: a limiting factor of Java applications on emerging multi-core platforms , 2009, OOPSLA.

[15]  Simon Peyton Jones,et al.  The Glasgow Haskell Compiler , 2012 .

[16]  Chuck Lever,et al.  Accept() Scalability in Linux , 2000, USENIX Annual Technical Conference, FREENIX Track.

[17]  Bryan O'Sullivan,et al.  Scalable i/o event handling for GHC , 2010 .

[18]  Ivo Balbaert The Way to Go: A Thorough Introduction to the Go Programming Language , 2012 .

[19]  W. Richard Stevens,et al.  Unix network programming , 1990, CCRV.

[20]  Simon L. Peyton Jones,et al.  Extending the Haskell foreign function interface with concurrency , 2004, Haskell '04.

[21]  Nick McKeown,et al.  OpenFlow: enabling innovation in campus networks , 2008, CCRV.

[22]  Johan Tibell,et al.  Scalable i/o event handling for GHC , 2010, Haskell.