playframework - Play Framework and Threadpools -
is there limit on number of threads play framework exposes application? thread size inside play app darn precious? if use thread pool create myself in application , not use 1 provided play. recommended? can please throw light on how play handles threads?
the limit of threads in play application have determined maximum memory allocated vm. threads consume fair bit of memory each, since own stack. essentially, maximum number of threads possible depends on arguments pass jvm , total ram on computer, etc.
you should let play manage threads you. configuration documentation located here. part of design of play deals in minimizing number of threads need, unless you're doing lot of blocking calls shouldn't need touch it.
play uses akka handle threading. configuration internal actor system can found here. juicy part in parallelism-factor
, parallelism-max
. if @ commented reference configuration akka:
# parallelism factor used determine thread pool size using # following formula: ceil(available processors * factor). resulting size # bounded parallelism-min , parallelism-max values. parallelism-factor = 3.0 # max number of threads cap factor-based parallelism number parallelism-max = 64
play's parallelism-factor
default set 1, based on reference configuration. means default, play have thread pool equal number of processors available, maximum of 24.
Comments
Post a Comment