Earlier quoted context omitted.
Postgres is good, even great, but this is hyperbole. Postgres has its downsides, autovacuum being one of them.
Although the article doesn't mention it, index bloat will be far better controlled in Postgres 14: https://www.postgresql.org/docs/devel/btree-implementation.h... One benchmark involving a mix of queue-like inserts, updates, and deletes showed that it was practically 100% effective at controlling index bloat: https://www.postgresql.org/message-id/CAGnEbogATZS1mWMVX8FzZ... The Postgres 13 baseline for the benchmark/te…
An early look at Postgres 14: Performance and monitoring Improvements
131–140 of 254 posts
Re: An early look at Postgres 14: Performance and monitoring Improvements
#132Postgres is one of those pieces of software that’s so much better than anything else, it’s really incredible. I wonder if it’s even possible for competitors to catch up at this point - there’s not a lot of room for improvement in architecture of relational databases any more. I’m starting to think that Postgres is going to be with us for decades maybe even centuries. Do any other entrenched software projects come to…
I'm an enormous fan of Postgres, it's my default go-to RDBMS. But the memory expense of connections is a huge issue and this article doesn't convince me that it's solved. The machine being used for this benchmark has 96 vCPUs, 192G of RAM, and costs $3k/mo. My business runs just fine on a 3.75G, 1 vCPU instance. But idle connections eat up a huge amount of RAM and I sometimes find myself hitting the limits when a loa…
As for the per-connection memory usage, the big question is whether there really is a problem (and perhaps if there's a reasonable workaround). It's not quite clear to me why you think the issues in your case are are due to idle connections, but OK.
There are two things to consider:
1) The fixed per-connection memory (tracking state, locks, ..., a couple kBs or so). You'll pay this even for unused connections.
2) Per-process memory (each connection is handled by a separate thread).
It's difficult to significantly reduce (1) because that state would no matter what the architecture is, mostly. Dealing with (2) would probably require abandoning the current architecture (process per connection) and switching to threads. IMO that's unlikely to happen, because:
(a) the process isolation actually a nice thing from the developer perspective (less locking, fewer data races, ...)
(b) processes work quite fine for reasonable number of long-lived connections, and for connection pools address a lot of the other cases
(c) PostgreSQL supports a lot of platforms, some of which may not may not have very good multi-threading support (and supporting both architectures would be quite a burden)
But that's just my assessment, of course.
Re: An early look at Postgres 14: Performance and monitoring Improvements
#133Earlier quoted context omitted.
I'm an enormous fan of Postgres, it's my default go-to RDBMS. But the memory expense of connections is a huge issue and this article doesn't convince me that it's solved. The machine being used for this benchmark has 96 vCPUs, 192G of RAM, and costs $3k/mo. My business runs just fine on a 3.75G, 1 vCPU instance. But idle connections eat up a huge amount of RAM and I sometimes find myself hitting the limits when a loa…
I agree - the disparity between the cost of idle connections in Postgres vs MSSQL is hampering our ability to migrate.
Re: An early look at Postgres 14: Performance and monitoring Improvements
#134Postgres is one of those pieces of software that’s so much better than anything else, it’s really incredible. I wonder if it’s even possible for competitors to catch up at this point - there’s not a lot of room for improvement in architecture of relational databases any more. I’m starting to think that Postgres is going to be with us for decades maybe even centuries. Do any other entrenched software projects come to…
I'm an enormous fan of Postgres, it's my default go-to RDBMS. But the memory expense of connections is a huge issue and this article doesn't convince me that it's solved. The machine being used for this benchmark has 96 vCPUs, 192G of RAM, and costs $3k/mo. My business runs just fine on a 3.75G, 1 vCPU instance. But idle connections eat up a huge amount of RAM and I sometimes find myself hitting the limits when a loa…
Re: An early look at Postgres 14: Performance and monitoring Improvements
#135Earlier quoted context omitted.
Pg_upgrade [0] is an official part of postgres and does the binary inplace upgrade for you. You should obviously test before running in production, but it has worked perfectly for us when upgrading a 10+TB cluster from pg11 to pg13 [0] https://www.postgresql.org/docs/current/pgupgrade.html
Not totally ideal if you're using containers as it requires the binaries of the old and new version, unless I'm missing something.
Re: An early look at Postgres 14: Performance and monitoring Improvements
#136Earlier quoted context omitted.
EXPLAIN (ANALYZE, BUFFERS) Take the result of this and paste it into https://explain.depesz.com/ which will make it human readable. Understanding this is sometimes very easy, but if you want to understand what they _really_ mean, you can read depesz.com
Wow, how have I never heard of this tool?! Thanks a lot for the link!
Re: An early look at Postgres 14: Performance and monitoring Improvements
#137Earlier quoted context omitted.
EXPLAIN (ANALYZE, BUFFERS) Take the result of this and paste it into https://explain.depesz.com/ which will make it human readable. Understanding this is sometimes very easy, but if you want to understand what they _really_ mean, you can read depesz.com
I use it frequently - but I wish there was a tool which went into the semantics somewhat.
Re: An early look at Postgres 14: Performance and monitoring Improvements
#138Earlier quoted context omitted.
Postgres is good, even great, but this is hyperbole. Postgres has its downsides, autovacuum being one of them.
Although the article doesn't mention it, index bloat will be far better controlled in Postgres 14: https://www.postgresql.org/docs/devel/btree-implementation.h... One benchmark involving a mix of queue-like inserts, updates, and deletes showed that it was practically 100% effective at controlling index bloat: https://www.postgresql.org/message-id/CAGnEbogATZS1mWMVX8FzZ... The Postgres 13 baseline for the benchmark/te…
Re: An early look at Postgres 14: Performance and monitoring Improvements
#139Earlier quoted context omitted.
I'm an enormous fan of Postgres, it's my default go-to RDBMS. But the memory expense of connections is a huge issue and this article doesn't convince me that it's solved. The machine being used for this benchmark has 96 vCPUs, 192G of RAM, and costs $3k/mo. My business runs just fine on a 3.75G, 1 vCPU instance. But idle connections eat up a huge amount of RAM and I sometimes find myself hitting the limits when a loa…
Setting up pgbouncer is not much headache and for for OLTP workloads, it works great. You can even see it in the graph, that best performance is when number of CPU cores = number of connections. And so will be memory use. :)
There are three pooling modes:
- Session pooling. Doesn't help with this issue since it doesn't reduce the total number of required connections.
- Transaction pooling / statement pooling. Breaks too many things to be usable. (eg. prepared statements...)
See the table at https://www.pgbouncer.org/features.html for what features cannot be used with transaction pooling.
Re: An early look at Postgres 14: Performance and monitoring Improvements
#140All I want is to be able to use Postgres in production without the need of pgbouncer.
Care to elaborate? Having each tool handle its job sounds like a good strategy.
In an ideal world PostgreSQL would handle infinite number of connections without a connection pool. Unlikely in practicem though.
There are good practical reasons to actually limit the number of connections:
(a) CPU efficiency (optimal number of active connections is 1-2x number of cores)
(b) allows higher memory limits
(c) lower risk of connection storms
(d) ... probably more
Some applications simply ignore this and expect rather high number of connections, with the assumption most of them will be idle. Sometimes the connections are opened/closed frequently, making it worse.
Eliminating the need for a connection pool in those cases would probably require significant changes to the architecture, so that e.g. forking a process is not needed.
But my guess is that's not going to happen. A more likely solution is having a built-in connection pool which is easier to configure / operate.
Separate connection pools (like pgbouncer) are unlikely to go away, though, because being able to run them on a separate machine is a big advantage.