作者
digoal
日期
2020-03-20
标签
PostgreSQL , 连接池
背景
在高并发场景中, 连接池比较重要, 特别对于当前的PG(进程模型, 并且还没有支持内置线程连接池).
PG的连接池也比较多, pgpool, odyssey, pgbouncer等, 个有特色.
odyssey, 多线程连接池:
《PostgreSQL 多线程连接池 - Scalable PostgreSQL connection pooler odyssey》
内置线程池, 特色, 上万并发性能不衰.
《PostgresPro buildin pool(内置连接池)版本 原理与测试》
《PostgreSQL PRO 特性 - 内置连接池 - build-in pool 相关参数》
pgpool, 不仅是个连接池, 更是个读写分离代理, 实际上应该说它的主要能力是读写分离代理.
《阿里云RDS PostgreSQL 12 + pgpool 的读写分离配置》
pgbouncer, 单进程, 处理吞吐5万qps左右.
又一个连接池来了: pgagroal, 多进程, 每个连接一个进程对应, 主打性能, 但是每个连接对应一个进程, 上万连接性能不一定好, 自己可以去测试一下印证想法. (他们自己放出来的测试最高200个连接)
https://agroal.github.io/pgagroal/gettingstarted.html
https://agroal.github.io/pgagroal/
Features
- High performance
- Connection pool
- Limit connections for users and databases
- Prefill support
- Remove idle connections
- Connection validation
- Graceful / fast shutdown
- Daemon support
- User vault
Overview
- pgagroal makes use of
- Process model
- Shared memory model across processes
- libev for fast network interactions
- Atomic operations are used to keep track of state
- The PostgreSQL native protocol v3 for its communication
PostgreSQL 许愿链接
您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.
9.9元购买3个月阿里云RDS PostgreSQL实例
PostgreSQL 解决方案集合
德哥 / digoal's github - 公益是一辈子的事.





