Browse Source

Applied @Skamander's recommendations for the connection pool size and fixed up the locator for the Akka dispatcher (we need to fix our Play doc on this subject).

I have observed that the thread pool executor is now being used with the correct number of threads.
Christopher Hunt 12 years ago
parent
commit
e18324a3a0

+ 1 - 1
play-java/app/controllers/Application.java

@@ -26,7 +26,7 @@ public class Application extends Controller {
     //http://stackoverflow.com/questions/3907929/should-i-make-jacksons-objectmapper-as-static-final
     private static final ObjectMapper objectMapper = new ObjectMapper();
 
-    private static final ExecutionContext dbEc = Akka.system().dispatchers().lookup("db");
+    private static final ExecutionContext dbEc = Akka.system().dispatchers().lookup("akka.actor.db");
 
     public static Result json() {
         final ObjectNode result = objectMapper.createObjectNode();

+ 10 - 7
play-java/conf/application.conf

@@ -35,17 +35,17 @@ db.default.user=benchmarkdbuser
 db.default.password=benchmarkdbpass
 db.default.jndiName=DefaultDS
 
-db.default.partitionCount=2
+db.default.partitionCount=4
 
 # The number of connections to create per partition. Setting this to 
 # 5 with 3 partitions means you will have 15 unique connections to the 
 # database. Note that BoneCP will not create all these connections in 
 # one go but rather start off with minConnectionsPerPartition and 
 # gradually increase connections as required.
-db.default.maxConnectionsPerPartition=5
+db.default.maxConnectionsPerPartition=24
 
 # The number of initial connections, per partition.
-db.default.minConnectionsPerPartition=5
+db.default.minConnectionsPerPartition=24
 
 # Evolutions
 # ~~~~~
@@ -87,14 +87,17 @@ play {
           parallelism-max = 300
         }
       }	
-      db {
+      db = {
+        executor = "thread-pool-executor"
         thread-pool-executor {
           core-pool-size-factor = 1.0
-          core-pool-size-min = 10
-          core-pool-size-max = 10
+          core-pool-size-min = 96
+          core-pool-size-max = 96
+          max-pool-size-factor = 1.0
+          max-pool-size-min = 96
+          max-pool-size-max = 96
         }
       }
-
     }
   }
 }

+ 1 - 1
play-scala/app/controllers/Application.scala

@@ -19,7 +19,7 @@ object Application extends Controller {
   def db(queries: Int) = Action {
     import play.api.libs.concurrent.Execution.Implicits._
 
-    val dbEc: ExecutionContext = Akka.system.dispatchers.lookup("db")
+    val dbEc = Akka.system.dispatchers.lookup("akka.actor.db")
 
     Async {
       val random = ThreadLocalRandom.current()

+ 10 - 7
play-scala/conf/application.conf

@@ -36,17 +36,17 @@ db.default.user=benchmarkdbuser
 db.default.password=benchmarkdbpass
 db.default.jndiName=DefaultDS
 
-db.default.partitionCount=3
+db.default.partitionCount=4
 
 # The number of connections to create per partition. Setting this to 
 # 5 with 3 partitions means you will have 15 unique connections to the 
 # database. Note that BoneCP will not create all these connections in 
 # one go but rather start off with minConnectionsPerPartition and 
 # gradually increase connections as required.
-db.default.maxConnectionsPerPartition=800
+db.default.maxConnectionsPerPartition=24
 
 # The number of initial connections, per partition.
-db.default.minConnectionsPerPartition=10
+db.default.minConnectionsPerPartition=24
 
 # Evolutions
 # ~~~~~
@@ -82,14 +82,17 @@ play {
           parallelism-max = 300
         }
       }
-      db {
+      db = {
+        executor = "thread-pool-executor"
         thread-pool-executor {
           core-pool-size-factor = 1.0
-          core-pool-size-min = 100
-          core-pool-size-max = 100
+          core-pool-size-min = 96
+          core-pool-size-max = 96
+          max-pool-size-factor = 1.0
+          max-pool-size-min = 96
+          max-pool-size-max = 96
         }
       }
-
     }
   }
 }