PostgreSQL- Performance deviation on run same test and workload on multiple trails #286
-
PostgreSQLv14 source code compiled with GCCv11 and binaries' installed in /usr/test/pgsqlv14-gcc. steps are followedumount /usr/local/pgsql/data
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 7 replies
-
Moved to Discussions as this is a PostgreSQL configuration issue rather than a HammerDB one. So to start with you don't give any details about your hardware configuration so CPUs, (which ones, how many cores?) memory & I/O. Secondly, you don't include your PostgreSQL configuration such as the postgresql.conf. You need to include a lot more information about your environment to be able to get any help. Thirdly and most importantly, you don't include any details about database and system performance and wait events during the test. So what are the top wait events in PostgreSQL when it is running? What is the CPU utilization etc, You also don't give the actual NOPM/TPM values. So, to start with, I would recommend stepping back a bit and watch the introductory talk linked here https://www.hammerdb.com/about.html and then read the documentation and blog eg https://www.hammerdb.com/blog/uncategorized/how-many-warehouses-for-the-hammerdb-tpc-c-test/ (250 vusers on 500 warehouses is too high). In the video in particular, pay close attention to performance profiles at about 45 minutes. Always start with 1VU then 2, 4 etc and plot the graph of your system's potential - you should see a smooth curve as the load increases. If you have configured the database and system correctly and you run the test twice your lines with overlay each other closely. |
Beta Was this translation helpful? Give feedback.
-
@sm-shaw and @anilbommareddy Similar behavior observed on PostgreSQLv14 with below Environment( benchmark and configuration). On Perf observed the top functions for most of vu's(example 24vu). build_schema.tcl.txt
|
Beta Was this translation helpful? Give feedback.
-
@arjunshetty955 the attached files like Hammerdb and postgres.conf similar.
|
Beta Was this translation helpful? Give feedback.
-
There are a lot of introductory database benchmarking topics here, but they are useful for other people following the thread in future. To start with, you are assuming linear core and cross-socket scalability from the combination of hardware and software, you are using, is this a valid assumption? Do you have empirical evidence to back this proposition up? Let's take the above questions first:
This will help you drill down on the actual PostgreSQL wait events rather than just the group and top functions. So to step back on the empirical evidence side - you don't mention whether your data is TPM or NOPM? However, this aside, I have seen data for HammerDB v4.2 workloads on PostgreSQL 13 on x86-64 2 x socket systems in the range between 2.5M to 3M NOPM. So we do know that HammerDB performance on an alternative configuration can exceed what you see here. Also, the data from a commercial database is again significantly higher, so we know that the bottleneck is not in HammerDB and this is not a HammerDB issue. So next, let's graph your data, the data points from both runs are very close initially, then there is some minor variance at higher VU counts (your research on autovacuum can explain why this is the case) but then you sort of gave up after 72 and jumped straight to 192 and 256 virtual Users. Also, as previous, note that a NOPM value is an average over a period of time. A single run with a lot of variance with higher and lower points may produce the same average as something that is in-between and very consistent. Consistent is what you want - here is a laptop example: So, it is clear that this is not a HammerDB issue and out of scope for further HammerDB support, in fact this is exactly what HammerDB is for to explore the potential of your database hardware and software. In this example, you are seeing the scalability limitations of your configuration and should drill down into the statistics to understand where these are. There is a very clear hint in seeing 14.99% postgres postgres [.] LWLockAcquire as the top function so I would suggest starting there. |
Beta Was this translation helpful? Give feedback.
-
@sm-shaw : Thank you for info and the explanation on HammerDB. is HammerDBv4.3 give info as PostgreSQL threads are bound to Numa Nodes(threads are related/acquired from Numa Nodes(CPU_AFFINITY)? |
Beta Was this translation helpful? Give feedback.
-
Hi, the question about threads is not entirely clear. HammerDB itself is not impacted by NUMA issues as the Virtual Users which are OS threads are independent of each other and there is no GIL in the language used https://www.hammerdb.com/blog/uncategorized/what-programming-languages-does-hammerdb-use-and-why-does-it-matter/. PostgreSQL is not thread based but is process based. I would recommend repeating your test but with a gap of 4 or 8 virtual users and continue past 72 rather than jumping to high thread counts. For the minor variations in results after multiple tests related to autovacuum use a tool such as this https://bucardo.org/check_postgres/ to check for table bloat. Vacuum full or rebuild (which are basically the same thing) will remove the bloat. As session counts increase and performance does not, this is related to overall system scalability (and not a HammerDB problem because as above we have already noted higher performance elsewhere - I do not give exact details as HammerDB never publishes any benchmarks directly, performance data is only used for reference or illustration). In particular, as you add Virtual Users you should look to see if the CPU utilisation is increasing or are particular wait events increasing instead and you can't increase the utilisation any higher (i.e. scalability). The new GUI metrics will show LWLock in pink. |
Beta Was this translation helpful? Give feedback.
Hi, the question about threads is not entirely clear. HammerDB itself is not impacted by NUMA issues as the Virtual Users which are OS threads are independent of each other and there is no GIL in the language used https://www.hammerdb.com/blog/uncategorized/what-programming-languages-does-hammerdb-use-and-why-does-it-matter/. PostgreSQL is not thread based but is process based.
The new HammerDB statistics will report information from the active session history.
I would recommend repeating your test but with a gap of 4 or 8 virtual users and continue past 72 rather than jumping to high thread counts. For the minor variations in results after multiple tests related to autovacuum use a tool …