当前位置:网站首页>Customize MySQL connection pool
Customize MySQL connection pool
2022-06-28 12:51:00 【51CTO】
Recently, I learned the general pooling framework commons-pool2
After practice , Again HTTP The performance test has been carried out , The results were unexpected , It is of no use to improve performance . After my own local test , The performance is good enough .
Then I thought it over , I used the wrong place . Originally I wanted to write one by myself Redis Of the connection pool ,jedis
The connection pool itself is commons-pool2
Developed , I was a little surprised , Seems to think the same .commons-pool2
It is very good for connection pooling .
I looked carefully for , It is found that there is still a lack of a local MySQL Connection pool , instead of springboot Then you need to start a service . Of course, there should be , But I really want to write one myself and then do all kinds of tests , So I didn't look for it carefully .
Poolable object
First , We need a poolable object , I chose com.funtester.db.mysql.FunMySql
, This is a single link that I wrote myself MySQL object . I plan to use this as a base for poolable objects .
Pool chemical plant
Relative connection , establish com.funtester.db.mysql.FunMySql
When , By the way, initialize MySQL Connect . And then again com.funtester.db.mysql.MysqlPool.FunTester#destroyObject
The connection is recycled .
Object pool
There is some redundancy here , In the process of later use , I will continue to optimize . By creating a com.funtester.db.mysql.MysqlPool
object , Get one com.funtester.db.mysql.FunMySql
Object pool .
API encapsulation
Since learning Go Linguistic gorm The framework and Redis frame , I found that there is no need to expose the relevant information about pooling , Directly encapsulate the original API, Exposed to users for use , In this way, users do not have to worry about the recycling of connections .
BUG excavating machinery · Performance conqueror · Head pot cover
边栏推荐
- pwn入门(1)二进制基础
- Vs2012 VC creates a new blank window application
- 吐血推荐17个提升开发效率的“轮子”
- Unity Editor Extension Foundation, GUI
- 杰理之wif 干扰蓝牙【篇】
- Performance test-01-introduction
- Online JSON to plaintext tool
- 思源官方付费同步使用指南
- From jsonpath and XPath to spl
- Copying open source for basic software is not advisable. Self reliance is the right way
猜你喜欢
I ² C. SMBus, pmbus relationships
攻防世界新手入门hello_pwn
Tips for using ugui (V) using scroll rect component
高考失利进哈工大,毕业却留校要当“探索者”,丁效:科研就是厚积薄发
Go语学习笔记 - gorm使用 - 数据库配置、表新增 | Web框架Gin(七)
ASP. NET CORE Study05
mysql数据库扫盲,你真的知道什么是数据库嘛
从 jsonpath 和 xpath 到 SPL
ASP.NET CORE Study04
Unity Editor Extension Foundation, GUI
随机推荐
Why does CAD export PDF have no color
Mysq 8.0 launched histogram, which greatly improved the performance!
我的NVIDIA开发者之旅-Jetson Nano 2gb教你怎么训练模型(完整的模型训练套路)
Flink流处理API大合集:掌握所有flink流处理技术,看这一篇就够了
Unity load settings: application backgroundLoadingPriority
Unity releases webgl and wakes up keyboard input on the mobile terminal inputfield
June 28, 2022 Daily: Lecun's latest paper: the road to autonomous machine intelligence
小白创业做电商,选对商城系统很重要!
杰理之wif 干扰蓝牙【篇】
fastposter v2.8.4 发布 电商海报生成器
杰理之wif 干扰蓝牙【篇】
FineReport安装教程
UDP RTP packet frame loss
【MySQL从入门到精通】【高级篇】(三)MySQL用户的创建_修改_删除以及密码的设置
Tencent has confirmed that QQ has stolen numbers on a large scale, iphone14 has no chance of type-C, and 5g, the fourth largest operator, has officially released numbers. Today, more big news is here
An idea plug-in that automatically generates unit tests, which improves the development efficiency by more than 70%!
Wechat authorized login
newest! Introduction and practical tutorial of point cloud processing based on open3d
Bytev builds a dynamic digital twin network security platform -- helping network security development
go template with...end遍历用法