I have a simple code, using Kemal Crystal Framework with a database pooled connection but only mantain connection on startup, and each request decrease by one of connection to mysql.
As a DB::Database.using_connection says on docs:
yields a connection from the pool the connection is returned to the pool when the block ends
Must not be closed !!!
https://gist.github.com/valenciaj/534b5c820462db808eac13ba6c392614
您必须设置max_idle_pool_size DB :: Database参数以保持打开的连接。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.