application.conf 4.1 KB

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