Re: Make NUM_XLOGINSERT_LOCKS configurable

2024-01-15 Thread Jakub Wartak
On Fri, Jan 12, 2024 at 7:33 AM Bharath Rupireddy wrote: > > On Wed, Jan 10, 2024 at 11:43 AM Tom Lane wrote: > > > > Bharath Rupireddy writes: > > > On Wed, Jan 10, 2024 at 10:00 AM Tom Lane wrote: > > >> Maybe. I bet just bumping up the constant by 2X or 4X or so would get > > >> most of the

Re: Make NUM_XLOGINSERT_LOCKS configurable

2024-01-12 Thread Jim Nasby
On 1/12/24 12:32 AM, Bharath Rupireddy wrote: Test case: ./pgbench --initialize --scale=100 --username=ubuntu postgres ./pgbench --progress=10 --client=64 --time=300 --builtin=tpcb-like --username=ubuntu postgres Setup: ./configure --prefix=$PWD/inst/ CFLAGS="-ggdb3 -O3" > install.log && make -

Re: Make NUM_XLOGINSERT_LOCKS configurable

2024-01-11 Thread Bharath Rupireddy
On Wed, Jan 10, 2024 at 11:43 AM Tom Lane wrote: > > Bharath Rupireddy writes: > > On Wed, Jan 10, 2024 at 10:00 AM Tom Lane wrote: > >> Maybe. I bet just bumping up the constant by 2X or 4X or so would get > >> most of the win for far less work; it's not like adding a few more > >> LWLocks is

Re: Make NUM_XLOGINSERT_LOCKS configurable

2024-01-09 Thread Tom Lane
Bharath Rupireddy writes: > On Wed, Jan 10, 2024 at 10:00 AM Tom Lane wrote: >> Maybe. I bet just bumping up the constant by 2X or 4X or so would get >> most of the win for far less work; it's not like adding a few more >> LWLocks is expensive. But we need some evidence about what to set it to.

Re: Make NUM_XLOGINSERT_LOCKS configurable

2024-01-09 Thread Bharath Rupireddy
On Wed, Jan 10, 2024 at 10:00 AM Tom Lane wrote: > > Michael Paquier writes: > > This suggestion has showed up more than once in the past, and WAL > > insertion is a path that can become so hot under some workloads that > > changing it to a GUC would not be wise from the point of view of > > perf

Re: Make NUM_XLOGINSERT_LOCKS configurable

2024-01-09 Thread Tom Lane
Michael Paquier writes: > This suggestion has showed up more than once in the past, and WAL > insertion is a path that can become so hot under some workloads that > changing it to a GUC would not be wise from the point of view of > performance. Redesigning all that to not require a set of LWLocks

Re: Make NUM_XLOGINSERT_LOCKS configurable

2024-01-09 Thread Michael Paquier
On Tue, Jan 09, 2024 at 09:38:17PM -0500, Tom Lane wrote: > Making it an actual GUC would carry nontrivial costs, not least that > there are hot code paths that do "foo % NUM_XLOGINSERT_LOCKS" which > would go from a mask operation to a full integer divide. We are > unlikely to consider that on th

Re: Make NUM_XLOGINSERT_LOCKS configurable

2024-01-09 Thread Tom Lane
writes: > I recently used benchmarksql to evaluate the performance of postgresql. I > achieved nearly 20% improvement > with NUM_XLOGINSERT_LOCKS changed from 8 to 16 under some cases of high > concurrency. I wonder whether > it is feasible to make NUM_XLOGINSERT_LOCKS a co

Make NUM_XLOGINSERT_LOCKS configurable

2024-01-09 Thread 1111hqshj
Dear all, I recently used benchmarksql to evaluate the performance of postgresql. I achieved nearly 20% improvement with NUM_XLOGINSERT_LOCKS changed from 8 to 16 under some cases of high concurrency. I wonder whether it is feasible to make NUM_XLOGINSERT_LOCKS a configuration parameter, so th