[GHC] #5174: Running out of OS threads in a server

GHC cvs-ghc at haskell.org
Fri May 6 20:10:09 CEST 2011


#5174: Running out of OS threads in a server
-----------------------+----------------------------------------------------
    Reporter:  bos     |       Owner:                
        Type:  bug     |      Status:  new           
    Priority:  normal  |   Component:  Runtime System
     Version:  6.12.3  |    Keywords:                
    Testcase:          |   Blockedby:                
          Os:  Linux   |    Blocking:                
Architecture:  x86     |     Failure:  Runtime crash 
-----------------------+----------------------------------------------------
 I have a web server that uses my mysql-simple package, and it dies after
 serving several hundred requests.

 The mysql-simple package is a wrapper around the MySQL C API, which is
 unfortunately not signal-safe. GHC RTS signals kill it, so I've been using
 runInBoundThread to manage the signals from the Haskell world.

 Unfortunately, the number of OS threads in flight increases with every use
 of runInBoundThread, so after a few hundred requests, I run out of OS
 threads (the default limit being 1024 threads on Linux), and my process is
 killed.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5174>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list