| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.PoolConfig
Description
Connection pool configuration.
Synopsis
- data PoolConfig = PoolConfig {
- poolSize :: Int
- poolIdleTimeout :: Int
- poolStripes :: Maybe Int
- defaultPoolConfig :: PoolConfig
- poolConfigForWorkers :: Int -> PoolConfig
Documentation
data PoolConfig Source #
Connection pool configuration.
Constructors
| PoolConfig | |
Fields
| |
Instances
| Show PoolConfig Source # | |
Defined in Arbiter.Core.PoolConfig Methods showsPrec :: Int -> PoolConfig -> ShowS # show :: PoolConfig -> String # showList :: [PoolConfig] -> ShowS # | |
| Eq PoolConfig Source # | |
Defined in Arbiter.Core.PoolConfig | |
defaultPoolConfig :: PoolConfig Source #
10 connections, 300s idle timeout, 1 stripe. For workers, use poolConfigForWorkers.
poolConfigForWorkers :: Int -> PoolConfig Source #
Pool sized for a worker pool of workerCnt threads.
Returns a single-stripe pool with 2 * workerCnt connections (floor of 2).
A single stripe is intentional. Data.Pool.withResource pins each thread
to one stripe based on its capability and does not search other stripes
when its own is exhausted. With multiple stripes, threads from the same
worker pool can cluster on one stripe and starve it of free connections
even when other stripes are idle.