![]() |
||
---|---|---|
.github/workflows | ||
cmake | ||
debian | ||
docker | ||
docs | ||
documentation | ||
modules | ||
run-clang-format@de6e8ca07d | ||
scripts | ||
sources | ||
stress | ||
test | ||
third_party | ||
.clang-format | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
AUTHORS | ||
CMakeLists.txt | ||
LICENSE | ||
Makefile | ||
README.md | ||
cleanup-docker.sh | ||
docker-compose-test.yml | ||
odyssey-dev.conf | ||
odyssey.conf | ||
tsan-decoder |
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.
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-13
git clone git://github.com/yandex/odyssey.git
make local_build
make
Configuration reference
Service
Logging
- log_file
- log_format
- log_to_stdout
- log_syslog
- log_syslog_ident
- log_syslog_facility
- log_debug
- log_config
- log_session
- log_query
- log_stats
- stats_interval
Performance
System
Global limits
Listen
Routing
Storage
Database and user
- overview
- authentication
- password
- auth_common_name
- auth_query
- auth_query_db
- auth_query_user
- auth_pam_service
- client_max
- storage
- storage_db
- storage_user
- storage_password
- pool
- pool_size
- pool_timeout
- pool_ttl
- pool_discard
- pool_cancel
- pool_rollback
- client_fwd_error
- log_debug
- example
- example console