title: Play: Restart on code change takes long to shutdown and starting the Hikary Pool
body: <p>Waiting for the server to restart when working with Play cost us a lot of time.
  One thing I see in the log is that shutting down and starting the <em>HikaryPool</em> takes a lot of time (> 40 seconds).</p>
  
  <p>Here is the log:</p>
  
  <pre><code>2019-10-31 09:11:47,327 [info] application - Shutting down connection pool.
  2019-10-31 09:11:47,328 [info] c.z.h.HikariDataSource - HikariPool-58 - Shutdown initiated...
  2019-10-31 09:11:53,629 [info] c.z.h.HikariDataSource - HikariPool-58 - Shutdown completed.
  2019-10-31 09:11:53,629 [info] application - Shutting down connection pool.
  2019-10-31 09:11:53,629 [info] c.z.h.HikariDataSource - HikariPool-59 - Shutdown initiated...
  2019-10-31 09:11:53,636 [info] c.z.h.HikariDataSource - HikariPool-59 - Shutdown completed.
  2019-10-31 09:11:53,636 [info] application - Shutting down connection pool.
  2019-10-31 09:11:53,636 [info] c.z.h.HikariDataSource - HikariPool-60 - Shutdown initiated...
  2019-10-31 09:11:53,640 [info] c.z.h.HikariDataSource - HikariPool-60 - Shutdown completed.
  ....
  2019-10-31 09:12:26,454 [info] p.a.d.DefaultDBApi - Database [amseewen] initialized at jdbc:postgresql://localhost:5432/bpf?currentSchema=amseewen
  2019-10-31 09:12:26,454 [info] application - Creating Pool for datasource 'amseewen'
  2019-10-31 09:12:26,454 [info] c.z.h.HikariDataSource - HikariPool-68 - Starting...
  2019-10-31 09:12:26,455 [info] c.z.h.HikariDataSource - HikariPool-68 - Start completed.
  2019-10-31 09:12:26,455 [info] p.a.d.DefaultDBApi - Database [companyOds] initialized at jdbc:sqlserver://localhost:1433;databaseName=companyOds
  2019-10-31 09:12:26,455 [info] application - Creating Pool for datasource 'companyOds'
  2019-10-31 09:12:26,455 [info] c.z.h.HikariDataSource - HikariPool-69 - Starting...
  2019-10-31 09:12:26,456 [info] c.z.h.HikariDataSource - HikariPool-69 - Start completed.
  2019-10-31 09:12:26,457 [info] p.a.d.DefaultDBApi - Database [company] initialized at jdbc:oracle:thin:@castor.olymp:1521:citrin
  2019-10-31 09:12:26,457 [info] application - Creating Pool for datasource 'company'
  2019-10-31 09:12:26,457 [info] c.z.h.HikariDataSource - HikariPool-70 - Starting...
  2019-10-31 09:12:26,458 [info] c.z.h.HikariDataSource - HikariPool-70 - Start completed.
  2019-10-31 09:12:26,458 [info] p.a.d.DefaultDBApi - Database [amseewen] initialized at jdbc:postgresql://localhost:5432/bpf?currentSchema=amseewen
  2019-10-31 09:12:26,458 [info] application - Creating Pool for datasource 'amseewen'
  2019-10-31 09:12:26,458 [info] c.z.h.HikariDataSource - HikariPool-71 - Starting...
  2019-10-31 09:12:26,459 [info] c.z.h.HikariDataSource - HikariPool-71 - Start completed.
  2019-10-31 09:12:26,459 [info] p.a.d.DefaultDBApi - Database [companyOds] initialized at jdbc:sqlserver://localhost:1433;databaseName=companyOds
  2019-10-31 09:12:26,459 [info] application - Creating Pool for datasource 'companyOds'
  2019-10-31 09:12:26,459 [info] c.z.h.HikariDataSource - HikariPool-72 - Starting...
  2019-10-31 09:12:26,459 [info] c.z.h.HikariDataSource - HikariPool-72 - Start completed.
  </code></pre>
  
  <p>Is there a way to shorten this time?</p>
  
  <p><strong>Updates</strong></p>
  
  <p>I use The <em>Play</em> integration of Intellij. The build-tool is <em>sbt</em>. </p>
  
  <p>Here is the configuration:</p>
  
  <p><a href="https://i.stack.imgur.com/tPOpu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tPOpu.png" alt="Build Config"></a></p>
  
  <p><strong>sbt</strong> 1.2.8 </p>
  
  <p><strong>Thread Pools</strong></p>
  
  <p>We use the default thread pool for the application. For the Database access we use:</p>
  
  <pre><code>database.dispatcher {
    executor = "thread-pool-executor"
    throughput = 1
    thread-pool-executor {
      fixed-pool-size = 55 # db conn pool (50) + number of cores (4) + housekeeping (1)
    }
  }
  </code></pre>