0

We are using a Play application that queries MySQL quite frequently. In fact, almost every operation queries the database in some way.

As I understand it, Play is designed to support Async and non-blocking applications and encourages coding according to that. But since com.mysql.jdbc.Driver is a blocking JDBC Driver, I don't see a way around using non blocking queries.

We are having serious performance issue when our application is used by multiple (6-20) users at the same time. And it just gets slow over time as you start using application.

So I tried changing the default play akka configuration by putting this inside the application.conf as is suggested here for "highly synchronous applications": http://www.playframework.com/documentation/2.1.0/ThreadPools

play {
  akka {
    event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
    loglevel = WARNING
    actor {
      default-dispatcher = {
        fork-join-executor {
          parallelism-min = 300
          parallelism-max = 300
        }
      }
    }
  }
}

Question I have though is: Most other configuration in application.conf are key=value pairs, do I just put this json object directly in the file and it will just work? I don't get any errors when I do this so I think it accepts this?

If yes, how do I test that this took effect or not? I don't see performance of the application changing drastically. So I am not sure if I am getting something fundamentally wrong here. Any help, pointers or comments will be highly appreciated.

We are using Play 2.0.3 with OpenJDK 1.6 on linux box with 2 CPU and xmx of 2GB.

biesior
  • 55,576
  • 10
  • 125
  • 182
Ravish Bhagdev
  • 955
  • 1
  • 13
  • 27

1 Answers1

0

If your config file already has a section for default-dispatcher then you simply should ensure that it uses fork-join-executor and increase values for parallelism-min and parallelism-max.

You can add log-config-on-start = on option to play { akka { }} section of your config to log your full akka config on start of your application (and then check if default-dispatcher will have proper values for parallelism-min and parallelism-max).