Scalable PostgreSQL connection pooler
Go to file
Andrey 9a4554fcfe
Add pool_discard_query option (#488)
2023-04-24 12:17:45 +05:00
.github/workflows Reserve prep stmt (#397) 2022-01-18 14:08:15 +05:00
cmake Fix changelog generation script (#439) 2022-06-22 13:20:39 +03:00
config-examples Fix configs (#467) 2022-10-10 12:48:32 +05:00
debian Fix changelog generation script (#439) 2022-06-22 13:20:39 +03:00
docker Target session attr feature for storage (#456) 2022-08-18 17:15:13 +05:00
docs Update index.md 2021-05-28 02:24:31 +05:00
documentation Add pool_discard_query option (#488) 2023-04-24 12:17:45 +05:00
modules introduce a couple of hooks in auth & config reload 2021-04-12 21:58:06 +05:00
run-clang-format@39081c9c42 Add roles in console DB (#371) 2021-12-16 04:08:42 +05:00
scripts Generate changelog with mdb@yandex-team.ru as cc (#388) 2021-12-10 16:13:48 +05:00
sources Add pool_discard_query option (#488) 2023-04-24 12:17:45 +05:00
stress fix formatting & apply fmt target in MAkefiel (#251) 2020-12-28 16:22:53 +05:00
test Nits: include headers for explicit function (#455) 2022-08-16 16:53:37 +05:00
third_party Bugs autocommit (#476) 2022-11-21 18:34:24 +04:00
.clang-format LDAP auth in od 2021-04-28 17:54:56 +05:00
.gitignore Fix memory leaks with system server shutdown, fix prepared statemnet memeory leak (#458) 2022-08-23 18:39:43 +05:00
.gitmodules added style check to travis (#158) 2020-06-04 22:35:44 +05:00
AUTHORS Implement SHOW POOLS command 2018-12-24 17:37:40 +05:00
CMakeLists.txt Better prometheus support (#414) 2022-03-25 21:21:59 +05:00
LICENSE odyssey: update LICENSE and AUTHORS 2018-05-21 17:39:43 +03:00
Makefile Refactor: fix memory leak in pool, rename config files, drop scram routes from sample dev conf file (#401) 2022-01-10 13:47:54 +05:00
README.md Fix readme (#409) 2022-01-28 20:30:08 +04:00
cleanup-docker.sh change formatting (#250) 2020-12-28 15:43:31 +05:00
docker-compose-test.yml LDAP auth in od 2021-04-28 17:54:56 +05:00
docker-compose.yml Deb fixes for https://www.postgresql.org/message-id/flat/YOMyXyErQ50je0zh%40msg.df7cb.de#c997486f4403d814ff6d1967772e58eb 2021-12-03 21:52:33 +00:00
odyssey.conf Fix configs (#467) 2022-10-10 12:48:32 +05:00
tsan-decoder t-digest for latencies (#147) 2020-05-28 11:12:10 +05:00

README.md



Odyssey

Advanced multi-threaded PostgreSQL connection pooler and request router.

Project status

Odyssey is production-ready, it is being used in large production setups. We appreciate any kind of feedback and contribution to the project.

Coverity Scan Build Status

Design goals and main features

Multi-threaded processing

Odyssey can significantly scale processing performance by specifying a number of additional worker threads. Each worker thread is responsible for authentication and proxying client-to-server and server-to-client requests. All worker threads are sharing global server connection pools. Multi-threaded design plays important role in SSL/TLS performance.

Advanced transactional pooling

Odyssey tracks current transaction state and in case of unexpected client disconnection can emit automatic Cancel connection and do Rollback of abandoned transaction, before putting server connection back to the server pool for reuse. Additionally, last server connection owner client is remembered to reduce a need for setting up client options on each client-to-server assignment.

Better pooling control

Odyssey allows to define connection pools as a pair of Database and User. Each defined pool can have separate authentication, pooling mode and limits settings.

Authentication

Odyssey has full-featured SSL/TLS support and common authentication methods like: md5 and clear text both for client and server authentication. Odyssey supports PAM & LDAP authentication, this methods operates similarly to clear text auth except that it uses PAM/LDAP to validate user name/password pairs. PAM optionally checks the connected remote host name or IP address. Additionally it allows to block each pool user separately.

Logging

Odyssey generates universally unique identifiers uuid for client and server connections. Any log events and client error responses include the id, which then can be used to uniquely identify client and track actions. Odyssey can save log events into log file and using system logger.

CLI

Odyssey supports multiple command line options. Use /path/to/odyssey --help to see more

Architecture and internals

Odyssey has sophisticated asynchronous multi-threaded architecture which is driven by custom made coroutine engine: machinarium. Main idea behind coroutine design is to make event-driven asynchronous applications to look and feel like being written in synchronous-procedural manner instead of using traditional callback approach.

One of the main goal was to make code base understandable for new developers and to make an architecture easily extensible for future development.

More information: Architecture and internals.

Build instructions

Currently Odyssey runs only on Linux. Supported platforms are x86/x86_64.

To build you will need:

  • cmake >= 3.12.4
  • gcc >= 4.6
  • openssl
  • postgresql-server-dev-13
  • pg_config utility is in the PATH
git clone git://github.com/yandex/odyssey.git
cd odyssey
make local_build

Adapt odyssey-dev.conf then:

make local_run

Alternatively:

make console_run

Use docker environment for development (helpful for Mac users)

make start-dev-env

Set up your CLion to build project in container, manual.

Configuration reference

Service
Logging
Performance
System
Global limits
Listen
Routing
Storage
Database and user
Architecture and Internals