Thread: Getting rid of AtEOXact_Buffers (was Re: [Testperf-general] Re: [PERFORM] First set of OSDL Shared Memscalability results, some wierdness ...)
Getting rid of AtEOXact_Buffers (was Re: [Testperf-general] Re: [PERFORM] First set of OSDL Shared Memscalability results, some wierdness ...)
From
Tom Lane
Date:
I wrote: > Josh Berkus <josh@agliodbs.com> writes: >> First off, two test runs with OProfile are available at: >> http://khack.osdl.org/stp/298124/ >> http://khack.osdl.org/stp/298121/ > Hmm. The stuff above 1% in the first of these is > Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a unit mask of 0x00 (No unit mask) count 100000 > samples % app name symbol name > ... > 920369 2.1332 postgres AtEOXact_Buffers > ... > In the second test AtEOXact_Buffers is much lower (down around 0.57 > percent) but the other suspects are similar. Since the only difference > in parameters is shared_buffers (36000 vs 9000), it does look like we > are approaching the point where AtEOXact_Buffers is a problem, but so > far it's only a 2% drag. It occurs to me that given the 8.0 resource manager mechanism, we could in fact dispense with AtEOXact_Buffers, or perhaps better turn it into a no-op unless #ifdef USE_ASSERT_CHECKING. We'd just get rid of the special case for transaction termination in resowner.c and let the resource owner be responsible for releasing locked buffers always. The OSDL results suggest that this won't matter much at the level of 10000 or so shared buffers, but for 100000 or more buffers the linear scan in AtEOXact_Buffers is going to become a problem. We could also get rid of the linear search in UnlockBuffers(). The only thing it's for anymore is to release a BM_PIN_COUNT_WAITER flag, and since a backend could not be doing more than one of those at a time, we don't really need an array of flags for that, only a single variable. This does not show in the OSDL results, which I presume means that their test case is not exercising transaction aborts; but I think we need to zap both routines to make the world safe for large shared_buffers values. (See also http://archives.postgresql.org/pgsql-performance/2004-10/msg00218.php) Any objection to doing this for 8.0? regards, tom lane
Re: Getting rid of AtEOXact_Buffers (was Re: [Testperf-general] Re: [PERFORM] First set of OSDL Shared Memscalability results, some wierdness ...)
From
Josh Berkus
Date:
Tom, > We could also get rid of the linear search in UnlockBuffers(). The only > thing it's for anymore is to release a BM_PIN_COUNT_WAITER flag, and > since a backend could not be doing more than one of those at a time, > we don't really need an array of flags for that, only a single variable. > This does not show in the OSDL results, which I presume means that their > test case is not exercising transaction aborts; In the test, one out of every 100 new order transactions is aborted (about 1 out of 150 transactions overall). -- --Josh Josh Berkus Aglio Database Solutions San Francisco
Re: Getting rid of AtEOXact_Buffers (was Re: [Testperf-general] Re: [PERFORM] First set of OSDL Shared Memscalability results, some wierdness ...)
From
Tom Lane
Date:
Josh Berkus <josh@agliodbs.com> writes: >> This does not show in the OSDL results, which I presume means that their >> test case is not exercising transaction aborts; > In the test, one out of every 100 new order transactions is aborted (about 1 > out of 150 transactions overall). Okay, but that just ensures that any bottlenecks in xact abort will be down in the noise in this test case ... In any case, those changes are in CVS now if you want to try them. regards, tom lane
Re: Getting rid of AtEOXact_Buffers (was Re: [Testperf-general] Re: [PERFORM] First set of OSDL Shared Memscalability results, some wierdness ...)
From
Josh Berkus
Date:
Tom, > In any case, those changes are in CVS now if you want to try them. OK. Will have to wait until OSDL gives me a dedicated testing machine sometime mon/tues/wed. -- --Josh Josh Berkus Aglio Database Solutions San Francisco