Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
-
I agree that autovacuuming helps to maintain performance when retaining the same DB and executing multiple runs. My use-case is a bit different. I want consistency with a single run, when the DB is CPU bound. Specifically, I am measuring the impact of NUMA placement, hugepages, hyperthreading etc. So for me autovacuuming impacts those measurements quite a bit. Also since the DB grows during the run - I am restoring the DB each time. As ever, it all depends on what the goal of the measurement is. I am optimizing for consistency in a single CPU-bound run, my settings are probably not suitable for most production situations. |
Beta Was this translation helpful? Give feedback.
-
I wanted to share this in case others experience the same issues - as it took me a while to figure out what was going on.
I don't think this is a bug - more of a symptom of me deliberately loading the system to be CPU saturated, but it's interesting behavior nonetheless)
Background - I am deliberately trying to make my postgres DB CPU bound by having a small (300 WH) database that is fully read-cached, and using 100 vUsers on a 32 CPU Linux machine.
By default I observed that transactions occasionally drop from from ~21K to about ~2K all of a sudden - and the CPU spikes to near 100%. This is a much larger impact from vacuuming than I usually see (which is a 30-50% reduction, not 10X)
When I disable
autovacuum
in postgres.conf the issue goes away. Eventually I was able to capture what was going on in the postgres log.and the analyze statements are taking between a few seconds to almost 1 minute to complete
The work eventually completes, and the TPM rate goes back to normal - so there is no deadlock as such, but it is a very odd looking behavior.
FWIW - It is possible to force the transactions to fail after N milliseconds waiting for a lock in the postgres.conf file (
lock_timeout = 100
give a 100msec timeout). In this scenario hammerDB will rightly issue errors and move on.Beta Was this translation helpful? Give feedback.
All reactions