Re: Speed up Clog Access by increasing CLOG buffers
Dilip Kumar <dilipbalaut@gmail.com>
On Wed, Aug 30, 2017 at 12:54 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> That would have been better. In any case, will do the tests on some
> higher end machine and will share the results.
>
>> Given that we've changed the approach here somewhat, I think we need
>> to validate that we're still seeing a substantial reduction in
>> CLogControlLock contention on big machines.
>>
>
> Sure will do so. In the meantime, I have rebased the patch.
I have repeated some of the tests we have performed earlier.
Machine:
Intel 8 socket machine with 128 core.
Configuration:
shared_buffers=8GB
checkpoint_timeout=40min
max_wal_size=20GB
max_connections=300
maintenance_work_mem=4GB
synchronous_commit=off
checkpoint_completion_target=0.9
I have run taken one reading for each test to measure the wait event.
Observation is same that at higher client count there is a significant
reduction in the contention on ClogControlLock.
Benchmark: Pgbench simple_update, 30 mins run:
Head: (64 client) : (TPS 60720)
53808 Client | ClientRead
26147 IPC | ProcArrayGroupUpdate
7866 LWLock | CLogControlLock
3705 Activity | LogicalLauncherMain
3699 Activity | AutoVacuumMain
3353 LWLock | ProcArrayLoc
3099 LWLock | wal_insert
2825 Activity | BgWriterMain
2688 Lock | extend
1436 Activity | WalWriterMain
Patch: (64 client) : (TPS 67207)
53235 Client | ClientRead
29470 IPC | ProcArrayGroupUpdate
4302 LWLock | wal_insert
3717 Activity | LogicalLauncherMain
3715 Activity | AutoVacuumMain
3463 LWLock | ProcArrayLock
3140 Lock | extend
2934 Activity | BgWriterMain
1434 Activity | WalWriterMain
1198 Activity | CheckpointerMain
1073 LWLock | XidGenLock
869 IPC | ClogGroupUpdate
Head:(72 Client): (TPS 57856)
55820 Client | ClientRead
34318 IPC | ProcArrayGroupUpdate
15392 LWLock | CLogControlLock
3708 Activity | LogicalLauncherMain
3705 Activity | AutoVacuumMain
3436 LWLock | ProcArrayLock
Patch:(72 Client): (TPS 65740)
60356 Client | ClientRead
38545 IPC | ProcArrayGroupUpdate
4573 LWLock | wal_insert
3708 Activity | LogicalLauncherMain
3705 Activity | AutoVacuumMain
3508 LWLock | ProcArrayLock
3492 Lock | extend
2903 Activity | BgWriterMain
1903 LWLock | XidGenLock
1383 Activity | WalWriterMain
1212 Activity | CheckpointerMain
1056 IPC | ClogGroupUpdate
Head:(96 Client): (TPS 52170)
62841 LWLock | CLogControlLock
56150 IPC | ProcArrayGroupUpdate
54761 Client | ClientRead
7037 LWLock | wal_insert
4077 Lock | extend
3727 Activity | LogicalLauncherMain
3727 Activity | AutoVacuumMain
3027 LWLock | ProcArrayLock
Patch:(96 Client): (TPS 67932)
87378 IPC | ProcArrayGroupUpdate
80201 Client | ClientRead
11511 LWLock | wal_insert
4102 Lock | extend
3971 LWLock | ProcArrayLock
3731 Activity | LogicalLauncherMain
3731 Activity | AutoVacuumMain
2948 Activity | BgWriterMain
1763 LWLock | XidGenLock
1736 IPC | ClogGroupUpdate
Head:(128 Client): (TPS 40820)
182569 LWLock | CLogControlLock
61484 IPC | ProcArrayGroupUpdate
37969 Client | ClientRead
5135 LWLock | wal_insert
3699 Activity | LogicalLauncherMain
3699 Activity | AutoVacuumMain
Patch:(128 Client): (TPS 67054)
174583 IPC | ProcArrayGroupUpdate
66084 Client | ClientRead
16738 LWLock | wal_insert
4993 IPC | ClogGroupUpdate
4893 LWLock | ProcArrayLock
4839 Lock | extend
Benchmark: select for update with 3 save points, 10 mins run
Script:
\set aid random (1,30000000)
\set tid random (1,3000)
BEGIN;
SELECT abalance FROM pgbench_accounts WHERE aid = :aid for UPDATE;
SAVEPOINT s1;
SELECT tbalance FROM pgbench_tellers WHERE tid = :tid for UPDATE;
SAVEPOINT s2;
SELECT abalance FROM pgbench_accounts WHERE aid = :aid for UPDATE;
SAVEPOINT s3;
SELECT tbalance FROM pgbench_tellers WHERE tid = :tid for UPDATE;
END;
Head:(64 Client): (TPS 44577.1802)
53808 Client | ClientRead
26147 IPC | ProcArrayGroupUpdate
7866 LWLock | CLogControlLock
3705 Activity | LogicalLauncherMain
3699 Activity | AutoVacuumMain
3353 LWLock | ProcArrayLock
3099 LWLock | wal_insert
Patch:(64 Client): (TPS 46156.245)
53235 Client | ClientRead
29470 IPC | ProcArrayGroupUpdate
4302 LWLock | wal_insert
3717 Activity | LogicalLauncherMain
3715 Activity | AutoVacuumMain
3463 LWLock | ProcArrayLock
3140 Lock | extend
2934 Activity | BgWriterMain
1434 Activity | WalWriterMain
1198 Activity | CheckpointerMain
1073 LWLock | XidGenLock
869 IPC | ClogGroupUpdate
--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com
Commits
-
Use group updates when setting transaction status in clog.
- baaf272ac908 11.0 landed
- ccce90b39867 10.0 landed
-
Improve 64bit atomics support.
- e8fdbd58fe56 10.0 landed
-
Add ProcArrayGroupUpdate wait event.
- d4116a771925 10.0 landed
-
Make the different Unix-y semaphore implementations ABI-compatible.
- be7b2848c6d8 10.0 cited
-
Fix broken ALTER INDEX documentation
- 2143f5e12790 9.6.0 cited
-
Code and docs review for commit 3187d6de0e5a9e805b27c48437897e8c39071d45.
- d12e5bb79bb5 9.6.0 cited
-
Partition the freelist for shared dynahash tables.
- 44ca4022f3f9 9.6.0 cited
-
Correct StartupSUBTRANS for page wraparound
- 481725c0ba73 9.6.0 cited
-
Make idle backends exit if the postmaster dies.
- ac1d7945f866 9.6.0 cited
-
contrib/sslinfo: add ssl_extension_info SRF
- 49124613f134 9.6.0 cited
-
Reduce ProcArrayLock contention by removing backends in batches.
- 0e141c0fbb21 9.6.0 cited
-
Fix `make installcheck` for serializable transactions.
- 253de7e1eb9a 9.6.0 cited
-
Lockless StrategyGetBuffer clock sweep hot path.
- d72731a70450 9.5.0 cited
-
Reduce sinval synchronization overhead.
- b4fbe392f8ff 9.2.0 cited