Backlogでマルチスレッドでinsertしたときデッドロックみたいになってしまう現象を再現させるための実験プロジェクト
- Host = localhost
- Database = threadexam
- User = root
- Password = sa
sbt run
ab -n 30 -t 10 http://localhost:9000/test100
application.conf
# スレッド、コネクションプールに関する設定
db.default.hikaricp.maximumPoolSize = 24
threadexam {
threads {
service = 4
db = 8
app = 0
}
}
server/ansible/roles/play-app/templates/etc/backlog/play/prod.backlog-tokyo-5.conf.j2
default.hikaricp {
maximumPoolSize = 60
idleTimeout = 12600000
maxLifetime = 14400000
registerMbeans = true
}
backlog-domain/src/main/scala/backlog/domain/model/config/ThreadPoolConfiguration.scala
source.getOptInt("db.default.hikaricp.maximumPoolSize") orElse source.getOptInt("backlog.threadPool.db") getOrElse 20
backlog-domain/src/main/scala/backlog/support/DefaultContexts.scala
ExecutionContext.fromExecutorService(Executors.newCachedThreadPool)