application.conf 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # This is the main configuration file for the application.
  2. # ~~~~~
  3. # Secret key
  4. # ~~~~~
  5. # The secret key is used to secure cryptographics functions.
  6. play.http.secret.key = "`o0VB@vXStsF:ffwM5ZZ_r:GYkm96QM[nRUJLpEbI8hwLUdV;N<:UyUWI;lf/XP`"
  7. # The application languages
  8. # ~~~~~
  9. play.i18n.langs = [ "en" ]
  10. # Disable default filters
  11. play.filters.enabled = [ ]
  12. # Disable thread local, it's not used by this application
  13. # ~~~~~
  14. play.allowHttpContext = false
  15. play.jpa.allowJPAEntityManagerContext = false
  16. play.modules {
  17. enabled += "startup.StartupModule"
  18. }
  19. play.server.server-header = "Play2"
  20. play.server {
  21. netty {
  22. transport = "native"
  23. # Whether the Netty wire should be logged
  24. log.wire = false
  25. option {
  26. SO_BACKLOG = 8192
  27. SO_REUSEADDR = true
  28. "io.netty.channel.epoll.EpollChannelOption#SO_REUSEPORT" = true
  29. "io.netty.channel.epoll.EpollChannelOption#TCP_FASTOPEN" = 1
  30. child {
  31. SO_KEEPALIVE = true
  32. TCP_NODELAY = true
  33. SO_REUSEADDR = true
  34. # The default is 1 since Linux Kernel 3.13
  35. # You can check via "cat /proc/sys/net/ipv4/tcp_fastopen"
  36. # However 3 would be better, but we can't change it to that value because we don't have root permission when running the benchmarks
  37. "io.netty.channel.epoll.EpollChannelOption#TCP_FASTOPEN" = 1
  38. }
  39. }
  40. }
  41. }
  42. akka {
  43. actor {
  44. default-dispatcher {
  45. fork-join-executor {
  46. # one thread per core is enough
  47. # https://github.com/playframework/playframework/issues/7242#issuecomment-295215448
  48. parallelism-factor = 1.5
  49. # Information about the TechEmpower benchmark environment: https://www.techempower.com/benchmarks/#section=environment
  50. # The environment variable physical_cpu_count does NOT include the hyperthreaded cores!
  51. #parallelism-max = 14
  52. #parallelism-max = ${?thread_count}
  53. parallelism-max = 64
  54. task-peeking-mode="LIFO" # based on https://www.playframework.com/documentation/2.7.x/Migration24#Thread-pool-configuration
  55. }
  56. # https://doc.akka.io/docs/akka/2.5.11/dispatchers.html#looking-up-a-dispatcher
  57. # Throughput defines the maximum number of messages to be
  58. # processed per actor before the thread jumps to the next actor.
  59. # Set to 1 for as fair as possible.
  60. throughput = 64
  61. }
  62. }
  63. }
  64. # Number of database connections
  65. # https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
  66. # db connections = ((physical_core_count * 2) + effective_spindle_count)
  67. # https://www.techempower.com/benchmarks/#section=environment
  68. fixedConnectionPool = 17
  69. fixedConnectionPool = ${?db_pool_size}
  70. database.dispatcher {
  71. executor = "thread-pool-executor"
  72. throughput = 1
  73. thread-pool-executor {
  74. fixed-pool-size = ${fixedConnectionPool}
  75. }
  76. }
  77. # Database configuration
  78. # ~~~~~
  79. # You can declare as many datasources as you want.
  80. # By convention, the default datasource is named `default`
  81. db {
  82. default {
  83. # https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
  84. url = "jdbc:mysql://tfb-database:3306/hello_world"
  85. username = "benchmarkdbuser"
  86. password = "benchmarkdbpass"
  87. hikaricp {
  88. dataSource {
  89. characterEncoding=UTF-8
  90. dontTrackOpenResources=true
  91. dontCheckOnDuplicateKeyUpdateInSQL=true
  92. cachePrepStmts=true
  93. prepStmtCacheSize=500
  94. prepStmtCacheSqlLimit=2048
  95. useServerPrepStmts=true
  96. useLocalSessionState=true
  97. useLocalTransactionState=true
  98. rewriteBatchedStatements=true
  99. cacheResultSetMetadata=true
  100. cacheServerConfiguration=true
  101. cacheCallableStmts=true
  102. callableStmtCacheSize=250
  103. elideSetAutoCommits=true
  104. maintainTimeStats=false
  105. alwaysSendSetIsolation=false
  106. zeroDateTimeBehavior="convertToNull"
  107. traceProtocol=false
  108. jdbcCompliantTruncation=false
  109. useUnbufferedInput=false
  110. useReadAheadInput=true
  111. useSSL=false
  112. }
  113. maximumPoolSize = ${fixedConnectionPool}
  114. }
  115. jndiName = DefaultDS
  116. }
  117. }
  118. jpa.default = defaultPersistenceUnit