HNHacker News
TopNewBestAskShowJobs

x4m

153 karma · joined February 17, 2011

Postgres Hacker
submissionscomments
x4m··on We scaled PgBouncer to 4x throughput
Was a flight to space an iteration?
x4m··on We scaled PgBouncer to 4x throughput
As Odyssey maintainer, I have to admit that it is exceptionally difficult to achieve stability (e.i. quality) of PgBouncer.

It has two limitations: it is single threaded and it is developed only re-actively. PgBouncer docs used to say that prepared statements can never be supported, in 2022 we supported it in Odyssey and then PgBouncer implemented it too.

In a sense Odyssey is developed to motivate PgBouncer development. To provide alternatives that keep PgBouncer from stagnation.

Yet, I can't say that scalability with SO_REUSEPORT is a good solution.

x4m··on We scaled PgBouncer to 4x throughput
With Odyssey we have customers with 50k+ connections operating normally.

Also consider SQPR - it's a connection pooler with sharding capabilities. It handles data migration between shard on top of request routing. Odyssey will inherit this capability once it is stable enough in functions set.

x4m··on We scaled PgBouncer to 4x throughput
Just use https://github.com/yandex/odyssey :) It's a scalable PgBouncer.
x4m··on Unmerged Patches and Useful Failures: My Journey to Postgres Major Contributor
I'd love to! But MySQL is developed inside Oracle, and OCA somewhat scares me. Perhaps, I'll give a try to MariaDB or other forks.
x4m··on Pgactive: Postgres active-active replication extension
And there's also https://postgrespro.com/docs/enterprise/current/multimaster With a history behind it.
x4m··on SPQR: Scaling PostgreSQL via Sharding
I think this should run just fine, why not? As long as you have proper Postgres operator, such proxy will run normally on top of that.
x4m··on UUID v7
+1

there's already well maintained extension https://github.com/fboulnois/pg_uuidv7

It's slightly different from recommendations by draft RFC version (there's no counter), but fully within spec requirements. From practical point there's no difference at all.

x4m··on Why Steam Deck Is One of the Most Significant PC Gaming Moments in Years
FWIW Steam Deck runs 8k transactions per second if you build Postgres there. A nice place to work on open source development, actually. https://twitter.com/x4mmmmmm/status/1620984546216017921
x4m··on Features I'd Like in PostgreSQL
> Reduce the memory usage of prepared queries

FWIW Odyssey supports prepared statements in transaction pooling.

x4m··on C++ Asynchronous Framework
I concur that Odyssey docs are insufficient to build a big picture. But I'm trying to answer every question in the Internets about Odyssey :) Documenting is hard - everything seems obvious to me, but understand that may things are not that obvious. // Odyssey maintainer
x4m··on PostgreSQL 14 Internals Book
I think the book is free because Egor and PostgresPro want to develop the community. If you want to pay back - you can just start contributing to Postgres. No need to wait :)
x4m··on Important PostgreSQL 14 update to avoid silent corruption of indexes
You are running on up to date version which seems to have no known critical bugs.
x4m··on Important PostgreSQL 14 update to avoid silent corruption of indexes
Just revert d9d0762 or use actual REL_14_STABLE.
x4m··on Scalable PostgreSQL Connection Pooler
Transaction pooling rules are equivalent in Odyssey and PgBouncer.
x4m··on Scalable PostgreSQL Connection Pooler
It seems like there's issue when you have a user for accessing authentication table you login with the same user. It fails when due to mixing same pool for auth and for work. I'll look into differentiating these pools more closely. As a simple workaround you can setup different user for accessing password and not login into Odyssey with this user.
x4m··on Scalable PostgreSQL Connection Pooler
Odyssey could work fine on arm, but we've a small ASM function https://github.com/yandex/odyssey/blob/master/third_party/ma... . We need to reimplement it for ARM64 or at least fallback on some generic context swap.
x4m··on Scalable PostgreSQL Connection Pooler
Odyssey stands before the databases and packs thousands of NodeJS connection into few tens of real server connections.
x4m··on Scalable PostgreSQL Connection Pooler
I'm not actually aware of all detailed plans. My job is to advance PostgreSQL ecosystem. But I'll pass a question to someone with broader view.
x4m··on Scalable PostgreSQL Connection Pooler
I think there's a lot of different HA solutions - Patroni, Stolon, Pacemaker to name few.
x4m··on Scalable PostgreSQL Connection Pooler
I heard FAANG is now MANGA :)
x4m··on Scalable PostgreSQL Connection Pooler
There's already working part of libpq protocol for this - target_session_attrs. But the problem with target_session_attrs is that it just takes too long to discover new primary after failolver. We want to fix this within Odyssey.
x4m··on Scalable PostgreSQL Connection Pooler
Currently in Odyssey password_passthrough works only for cleartext auth, PAM and LDAP. Probably, we could make this for MD5 work too. And it's the whole purpose of SCRAM to defeat this feature :)

The other way to do so is auth_query - you provide a storage password to access auth data of the DB. This works for MD5 auth. When user wants to authenticate we just check credentials against what we see in the database.

x4m··on Scalable PostgreSQL Connection Pooler
Hmm, yes. ParameterStatus is not sent when search_path is changed. But I think it would be trivial to patch PostgreSQL to send it. I bet one even can push such patch through commitfest.
x4m··on Scalable PostgreSQL Connection Pooler
No. It's just about developer experience. PostgreSQL core developemnt under MacOS is just so great. You can develop PG patches completely without internet connection on a very old MacBook Air. And everything will be so blazingly fast. For Odyssey development MacOS user needs VM, Linux box or Docker.
x4m··on Scalable PostgreSQL Connection Pooler
I'd certainly recommend to run pooler on the same node to avoid double encryption. Reestablishing 2x connections, dealing with 2x restarts of VM - is kind of a downside too. However it's not strictly neccesary, Odyssey can run even in another AZ :)
x4m··on Scalable PostgreSQL Connection Pooler
We are also developing managed databases for US\EU market https://double.cloud/
x4m··on Scalable PostgreSQL Connection Pooler
Sure. We use Odyssey as a component of HA cluster in Yandex.Cloud. Odyssey runs on each node of a Patroni-like system. One day we want to implement load balancing functionality in Odyssey. So that your queries go to other node if local is overloaded or lagging long behind primary.
x4m··on Scalable PostgreSQL Connection Pooler
Yes, that's a problem. We use Docker only for developement. And mostly because Odyssey is based on epoll and just will not compile on MacOS.
x4m··on Scalable PostgreSQL Connection Pooler
Depends on how you measure performance :) pgagroal utilizes a lot of linux processes to track each connection state, we use coroutines packed into small number of processes. Actually if you have a bottleneck in multithreaded pooler - something really goes wrong. The database should consume most of resources. I'd be happy to help tuning Odyssey to someone who will bachmark both poolers (in fact there's only one number - number of worker processes..well, maybe pool_size too).

pgagroal claims performance superiority over all poolers [0]. I doubt that Odyssey was used in transaction pooling mode in those experiments.

[0] https://github.com/agroal/pgagroal/blob/master/doc/PERFORMAN...

Page 1 of 3Next →