Network server library to handle over 10,000 connections. Since
GHC 6.10.4 or earlier uses select(), it cannot handle connections over
1,024. This library uses the "prefork" technique to get over the
barrier. Each process handles threadNumberPerProcess
connections.
preforkProcessNumber
child server processes are preforked. So, this
server can handle preforkProcessNumber
* threadNumberPerProcess
connections. To stop all server, send SIGTERM to the parent
process. (e.g. kill `cat PIDFILE`
where the PID file name is
specified by pidFile
)
- type C10kServer = Handle -> TCPInfo -> IO ()
- data C10kConfig = C10kConfig {
- initHook :: IO ()
- exitHook :: String -> IO ()
- parentStartedHook :: IO ()
- startedHook :: IO ()
- sleepTimer :: Int
- preforkProcessNumber :: Int
- threadNumberPerProcess :: Int
- portName :: ServiceName
- pidFile :: FilePath
- user :: String
- group :: String
- runC10kServer :: C10kServer -> C10kConfig -> IO ()
Documentation
type C10kServer = Handle -> TCPInfo -> IO ()Source
The type of the first argument of runC10kServer
.
data C10kConfig Source
The type of configuration given to runC10kServer
as the second
argument.
C10kConfig | |
|
runC10kServer :: C10kServer -> C10kConfig -> IO ()Source
Run C10kServer
with C10kConfig
.