Scalable PostgreSQL connection pooler
Go to file
kirill reshke a5f716025c
fix coveirty issues + remove legacy (#224)
* fix a couple of severity issues

* emove lagacy

* zero cost debug macros on release

* dbg macro fix

* apply fmt

Co-authored-by: reshke <Kirill Reshke>
2020-10-26 17:29:05 +05:00
cmake fix coveirty issues + remove legacy (#224) 2020-10-26 17:29:05 +05:00
debian Debian package infrastructure 2017-08-21 15:18:28 +03:00
docker fix coveirty issues + remove legacy (#224) 2020-10-26 17:29:05 +05:00
documentation reopen log file on SIGUSR1 (#216) 2020-10-17 21:01:57 +05:00
modules odyssey: fix modules API + make headers better (#168) 2020-06-15 13:26:58 +05:00
run-clang-format@de6e8ca07d added style check to travis (#158) 2020-06-04 22:35:44 +05:00
scripts Upgrade dependency to PG11 and fix CI 2020-02-28 15:10:38 +05:00
sources fix coveirty issues + remove legacy (#224) 2020-10-26 17:29:05 +05:00
stress tcp keepalive settings 2020-07-22 13:05:16 +05:00
test fix coveirty issues + remove legacy (#224) 2020-10-26 17:29:05 +05:00
third_party fix coveirty issues + remove legacy (#224) 2020-10-26 17:29:05 +05:00
.clang-format Applying clang-format with saving indentations (#140) 2020-04-02 16:00:56 +05:00
.gitignore fix cmake for version (#201) 2020-08-04 09:00:14 +05:00
.gitmodules added style check to travis (#158) 2020-06-04 22:35:44 +05:00
.travis.yml fix scram, use postgresql 13 in build & tests (#223) 2020-10-26 10:00:17 +05:00
AUTHORS Implement SHOW POOLS command 2018-12-24 17:37:40 +05:00
CMakeLists.txt fix scram, use postgresql 13 in build & tests (#223) 2020-10-26 10:00:17 +05:00
LICENSE odyssey: update LICENSE and AUTHORS 2018-05-21 17:39:43 +03:00
Makefile add coverity build target to makefile 2020-10-26 12:51:56 +05:00
README.md add coverity scan badge (#222) 2020-10-22 18:07:39 +05:00
cleanup-docker.sh use SO_REUSEPORT to graceful shutdown 2020-08-10 13:39:09 +05:00
docker-compose-test.yml fix coveirty issues + remove legacy (#224) 2020-10-26 17:29:05 +05:00
odyssey-dev.conf show errors per route 2020-09-03 14:04:28 +05:00
odyssey.conf fix infinte loop + add signals tests 2020-08-10 13:39:09 +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. 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.

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-10
git clone git://github.com/yandex/odyssey.git
cd odyssey
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

Configuration reference

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