cgroup-rts-threads-0.2.0.0: A container-/cgroup-aware substitute for the GHC RTS `-N` flag
Safe HaskellNone
LanguageHaskell2010

Control.Concurrent.CGroup

Description

This module provides a container-/cgroup-aware substitute for GHC's RTS -N flag. See initRTSThreads.

Synopsis

Documentation

initRTSThreads :: IO () Source #

A container-/cgroup-aware substitute for GHC's RTS -N flag.

On most platforms, this sets the number of runtime threads to match the number of physical processors (see getNumProcessors), which is the default behavior of the GHC -N flag.

When running within a cgroup on linux (most often within a container), this observes the current process' cgroup cpu quota to constrain the number of runtime threads.

See CPUQuota