title: Limit number of thread in Play 2.1 framework
body: <p>I am using Play 2.1 with Scala to run several tests continuously.
  I am doing a <code>Future.traverse(tests)(test =&gt; Future(runTest(test))</code>.</p>
  
  <p>I want to limit the number of tests running in parallel so I want to limit the number of threads in the default dispatcher.</p>
  
  <p>I tried to put </p>
  
  <pre><code>play {
    akka {
      event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
      loglevel = WARNING
      actor {
        default-dispatcher = {
          fork-join-executor {
            parallelism-factor = 1.0
            parallelism-max = 2
          }
        }
      }
    }
  } 
  </code></pre>
  
  <p>in the <code>application.conf</code> but it seems it doesn't have any effect (when I run the program there still is one thread per core). The <code>application.conf</code> is correctly read for other play settings.</p>
  
  <p>I tried to get rid of the play{} surrounding it but it changes nothing.</p>
  
  <p>I tried different imports of executions contexts with no success:  </p>
  
  <pre><code>//import scala.concurrent.ExecutionContext.Implicits._
  import play.api.libs.concurrent.Execution.Implicits._
  </code></pre>
  
  <p>When I run the application I get this message so it seems that it is the default dispatcher which is used:</p>
  
  <pre><code>[info] play - Starting application default Akka system.
  </code></pre>
  
  <p>Does someone have an idea why I can't configure the default dispatcher?</p>
  
  <p>Thank you!</p>
  
  <p>List of threads :</p>
  
  <pre><code>main
  Reference Handler
  Finalizer
  Signal Dispatcher
  FSEvent thread
  Attach Listener
  play-scheduler-1
  Timer-0
  com.google.common.base.internal.Finalizer
  BoneCP-keep-alive-scheduler
  BoneCP-max-alive-scheduler
  BoneCP-pool-alive-scheduler
  application-akka.actor.default-dispatcher-2
  application-scheduler-1
  ForkJoinPool-3-worker-1
  default-scheduler-1
  default-scheduler-1
  default-scheduler-1
  default-akka.actor.default-dispatcher-3
  default-akka.actor.default-dispatcher-5
  default-akka.actor.default-dispatcher-3
  default-akka.actor.default-dispatcher-2
  default-akka.actor.default-dispatcher-5
  default-pinned-dispatcher-4
  play-akka.actor.default-dispatcher-2
  play-akka.actor.default-dispatcher-4
  Timer-1
  Timer-3
  Timer-4
  Hashed wheel timer #1
  Hashed wheel timer #2
  Hashed wheel timer #3
  AsyncHttpClient-Reaper
  AsyncHttpClient-Reaper
  AsyncHttpClient-Reaper
  default-pinned-dispatcher-4
  default-pinned-dispatcher-4
  New I/O boss #35
  New I/O boss #44
  </code></pre>
  
  <p>And 8 <code>play-internal-execution-context-</code> (1 to 8)</p>
  
  <p>And 8 <code>iteratee-execution-context-</code> (1 to 8)</p>
  
  <p>And 62 <code>New I/O worker #</code> (1 to 62)</p>